SQL code - call a column that has a reserved as the name keyword

Hi all

As seen in the title, one of the tables in the database that I am trying to extract information from one of its columns is a reserved keyword.

I am trying to run SQL on Oracle SQL Developer test code.

The simple code, I'm running is:

Select number

of specific_table

As a result:

ORA-01747: invalid column, table.column, or user.table.column specification

01747 00000 - "invalid user.table.column, table.column or column specification.

Is there some sort of way to get around this?
Any help would be greatly appreciated.

Thank you!

Yes, use the names in quotes:

SQL > create table tbl (number)
2.
create the table tbl (number, number)
*
ERROR on line 1:
ORA-00904: invalid identifier

SQL > create table tbl ("number")
2.

Table created.

SQL > insert
2 tbl
3 values (1)
4.

1 line of creation.

SQL > select number
2 tbl
3.
Select number
*
ERROR on line 1:
ORA-00936: lack of expression

SQL > select "number".
2 tbl
3.

number
----------
1

SQL >

SY.

PS you need to find the EXACT (creating) the spelling of the column name. Use the DESC or select XXX_TAB_COLUMNS.

Tags: Database

Similar Questions

Maybe you are looking for