Re: referencing column names properly - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: referencing column names properly
Date
Msg-id 20030209043849.GA3562@wolff.to
Whole thread Raw
In response to referencing column names properly  ("Sill-II, Stephen" <Stephen.Sill-II@ost.dot.gov>)
List 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 by date:

Previous
From: Roberto Mello
Date:
Subject: Re: query help/sugestions
Next
From: "Ross J. Reedstrom"
Date:
Subject: Re: referencing column names properly