Re: [SQL] can a column be aliased? - Mailing list pgsql-sql

From darcy@druid.net (D'Arcy J.M. Cain)
Subject Re: [SQL] can a column be aliased?
Date
Msg-id m0z3fPs-00006FC@druid.net
Whole thread Raw
In response to Re: [SQL] can a column be aliased?  ("Roderick A. Anderson" <raanders@altoplanos.net>)
List pgsql-sql
Thus spake Roderick A. Anderson
> > Thus spake James Olin Oden
> > > I know this is probably a strange question, but can you give a column
> > > name an alias?  The reason I ask is because I have recently realized I
> >
> > SELECT table1.oid AS custnum, table2.oid AS salesman FROM ...
> >
>
> Hot as flame bait, but is the AS a SQL92 standard?  Coming from an Oracle

Yes it is.

> background I used
>
>    select table1.oid custnum,
>           table2.oid salesman
>      from ...

This is accepted by the standard as well but doesn't seem to be accepted
by PostgreSQL.  Does Oracle accept AS?

<select list> ::=
      <asterisk>
    | <select sublist> [ { <comma> <select sublist> }... ]

<select sublist> ::=
      <derived column>
    | <qualifier> <period> <asterisk>

<derived column> ::= <value expression> [ <as clause> ]

<as clause> ::= [ AS ] <column name>

--
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.

pgsql-sql by date:

Previous
From: darcy@druid.net (D'Arcy J.M. Cain)
Date:
Subject: Re: [SQL] can a column be aliased?
Next
From: James Olin Oden
Date:
Subject: Re: [SQL] can a column be aliased?