Re: referencing column names properly

Поиск
Список
Период
Сортировка
От Ross J. Reedstrom
Тема Re: referencing column names properly
Дата
Msg-id 20030209055022.GA6860@wallace.ece.rice.edu
обсуждение исходный текст
Ответ на referencing column names properly  ("Sill-II, Stephen" <Stephen.Sill-II@ost.dot.gov>)
Список pgsql-sql
On Sat, Feb 08, 2003 at 06:34:31PM -0500, Sill-II, Stephen 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;
SELECT "User-Name", max("Date"), max("Time") from logs;

Assuming the MulTiCasIng you show is also in the table. SQL lets you
put anything at all in an identifier (table or column name) as long
as you quote it with double-quotes (")

Ross


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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: referencing column names properly
Следующее
От: "Hanan Hotmail"
Дата:
Сообщение: Design question: How to convert a given data structure to sql and the opposite.