Re: Wrong column names in ResultSetMetaData

Поиск
Список
Период
Сортировка
От Mike Martin
Тема Re: Wrong column names in ResultSetMetaData
Дата
Msg-id cemi1o$2bur$1@news.hub.org
обсуждение исходный текст
Ответ на Re: Wrong column names in ResultSetMetaData  ("Mike Martin" <mmartin@vieo.com>)
Список pgsql-jdbc
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



В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Mike Martin"
Дата:
Сообщение: Re: Wrong column names in ResultSetMetaData
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: Wrong column names in ResultSetMetaData