Re: [GENERAL] Does PostgreSQL support Constant Expression (Alias Name)?

2001-03-02 Thread Oliver Elphick

Raymond Chui wrote:
  >This is a multi-part message in MIME format.
  >--CDE89E33286CEE4876F664CE
  >Content-Type: text/plain; charset=us-ascii
  >Content-Transfer-Encoding: 7bit
  >
  >If  a table has columns fname, lname.
  >I want to do query like
  >
  >SELECT fname "First Name", lname "Last Name" FROM aTable;

SELECT fname AS "First Name", lname AS "Last Name" FROM aTable;

-- 
Oliver Elphick[EMAIL PROTECTED]
Isle of Wight  http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
 
 "I will lift up mine eyes unto the hills, from whence 
  cometh my help. My help cometh from the LORD, which 
  made heaven and earth."  
   Psalms 121:1,2 



---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



RE: [GENERAL] Does PostgreSQL support Constant Expression (Alias Name)?

2001-03-02 Thread Trewern, Ben
Title: RE: [GENERAL] Does PostgreSQL support Constant Expression (Alias Name)?







Try SELECT fname as "First Name", lname as "Last Name" FROM aTable;


Regards


Ben


> -Original Message-
> From: Raymond Chui [mailto:[EMAIL PROTECTED]]
> Sent: 02 March 2001 14:30
> To: [EMAIL PROTECTED]
> Subject: [GENERAL] Does PostgreSQL support Constant Expression (Alias
> Name)?
>
>
> If  a table has columns fname, lname.
> I want to do query like
>
> SELECT fname "First Name", lname "Last Name" FROM aTable;
>
> This SELECT statement is fine in Oracle, Sybase and Informix.
> But I get an error message in PostgreSQL
>
> Because I want the output like
>
> First Name | Last Name
> --
> fn   | ln
>
> instead default like
>
> fname | lname
> ---
> fn   | ln
>
> What is the correct way doing this in PostgreSQL?
> Thank you very much in advance!
>
>
>
> --Raymond
>
>