Oracle: Query column name with reserved keyword from a table

I happen to see a table(say X) created with column name using key words like NUMBER, GROUP . I could query the table X for all columns as

Select * from X;

To query one or two particular columns named as keywords, you need to use double quotes.

Select "NUMBER" from X;

Make note of the 'case'  as Select "number" from X; won't work.

Where table creation script is:

Create table X
( "NUMBER" varchar2(90),
   Creation_date date,
...
...
...);

No comments:

Post a Comment