Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Oracle SQL , how do you select columns by ordinal position?

Tags:

sql

oracle11g

I'm trying to study this database , and I want to look for column data based on its position , like so:

select * from V$RESERVED_WORDS where COLUMNS.FIRST like '%'

However, this doesn't seem to work. I get this error:

select * from V$RESERVED_WORDS where COLUMNS.FIRST like "%"
Error at Command Line:10 Column:57
Error report:
SQL Error: ORA-00904: "%": invalid identifier
00904. 00000 -  "%s: invalid identifier"
*Cause:    
*Action:

I'm using Oracle SQL . Any tips appreciated.

like image 471
Caffeinated Avatar asked Feb 02 '26 20:02

Caffeinated


1 Answers

You cant use ordinal, but you need to specify column name. Your query:

SELECT * FROM V$RESERVED_WORDS
WHERE KEYWORD LIKE '%';
like image 115
user_0 Avatar answered Feb 05 '26 09:02

user_0