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
  • 6,309
  • 3
  • 38
  • 64
SrikR
  • 231
  • 9
  • 17
  • 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,207
  • 1
  • 12
  • 23
0

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

Meghal Vasa
  • 41
  • 1
  • 3