0

I am getting the above error when I try to run the following query.

select ROW_NUMBER() OVER (PARTITION BY col1 ORDER By col1) as ROW , dt.* from  view dt

Can anyone tell me what I am doing wrong here?

output:

ORA-00923: FROM keyword not found where expected
00923. 00000 -  "FROM keyword not found where expected"
*Cause:    
*Action:
Error at Line: 1 Column: 87
underscore_d
  • 5,902
  • 3
  • 34
  • 60
SrikR
  • 201
  • 8
  • 16
  • 1
    c.f. [How do I escape a reserved word in Oracle?](https://stackoverflow.com/questions/1162381/how-do-i-escape-a-reserved-word-in-oracle) – underscore_d Oct 23 '17 at 12:52

2 Answers2

6

ROW is a reserved word in Oracle SQL, don't use it as an alias.

Stelium
  • 1,119
  • 1
  • 10
  • 22
0

I got the same error while I was using ROWNUM so be careful not to have ROW in any form in your QUERY