Re: referencing column names properly

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: referencing column names properly
Дата
Msg-id 20030209043849.GA3562@wolff.to
обсуждение исходный текст
Ответ на referencing column names properly  ("Sill-II, Stephen" <Stephen.Sill-II@ost.dot.gov>)
Список pgsql-sql
On Sat, Feb 08, 2003 at 18:34:31 -0500, "Sill-II, Stephen" <Stephen.Sill-II@ost.dot.gov> wrote:
> I have a table called logs with several columns whose names have '-' in
> them, e.g.   User-Name
> 
> I'm having trouble referencing these columns with SELECT statements.
> 
> What would the proper way to address these in a statement like this?
> 
> SELECT User-Name, max(Date), max(Time) from logs;

You need to use double quotes around the column name. When you do that
case will become significant. If you didn't quote the column name on
the create table command, then the name would have been converted to
lower case.


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

Предыдущее
От: Roberto Mello
Дата:
Сообщение: Re: query help/sugestions
Следующее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: referencing column names properly