Reputation: 13534
I am writing a very simple rank function to calculate the rank for each group by partitioning on some specific columns. The sql looks straightforward for me but I really dont understand why I am getting ORA error. Please find my sql and error as below. Any inputs would be appreciated. Thanks.
SQL :-
SELECT *,
RANK() OVER( PARTITION BY STUDENTID,BOOKISBN ORDER BY ISSUEDATE ) "RN"
FROM BORROWED_BY;
Error:-
ORA-00923: FROM keyword not found where expected
00923. 00000 - "FROM keyword not found where expected"
*Cause:
*Action:
Error at Line: 10 Column: 9
Upvotes: 0
Views: 222
Reputation: 1270493
When you use SELECT *
with other columns, you need to qualify it:
SELECT bb.*,
RANK() OVER (PARTITION BY STUDENTID, BOOKISBN ORDER BY ISSUEDATE ) as RN
FROM BORROWED_BY bb;
Upvotes: 1