Oliver Jowett wrote:
> > The only way to "name" a SQL query column is with AS. There's
> > corroboration in DatabaseMetaData:
> >
> > public boolean supportsColumnAliasing() throws SQLException
> >
> > Retrieves whether this database supports column aliasing.
> > If so, the SQL AS clause can be used to provide names for
> > computed columns or to provide alias names for columns as
> > required.
> >
> > In both cases, "names" and not "labels".
>
> Is an "alias name" the same as a "column name"?
In SQL, yes. A result column has a name, and the AS clause is
the way to reassign that name.
Try this on your favorite DBMS:
SELECT COL FROM (SELECT COL AS FOO FROM T) T1
It fails because the parenthesized query result has no column
named COL.
Mike