RE: Does PostgreSQL support Constant Expression (Alias Name)? - Mailing list pgsql-general

From Trewern, Ben
Subject RE: Does PostgreSQL support Constant Expression (Alias Name)?
Date
Msg-id 996802F75C3CD411B424001083FA445B059548@CET_PONXX_FP001
Whole thread Raw
List pgsql-general


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

Regards

Ben

> -----Original Message-----
> From: Raymond Chui [mailto:raymond.chui@noaa.gov]
> Sent: 02 March 2001 14:30
> To: pgsql-general@postgresql.org
> 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
>
>

pgsql-general by date:

Previous
From: "Trewern, Ben"
Date:
Subject: RE: Convert to upper
Next
From: Peter Eisentraut
Date:
Subject: Re: Re: Thought on OIDs