Skip to Main Content

SQL Developer for VS Code

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Incorrect message when calling analytical functions in the WHERE clause

It's similar or even the same problem as https://forums.oracle.com/ords/apexds/post/incorrect-message-when-calling-sql-macro-in-the-with-clause-2524.

But in case that this is different problem I report it separately.

Schemat: HR

Query with an error:

-- window function are not allowed here
select  department_id, last_name, salary,
    RANK() OVER (ORDER BY salary desc) as rnk
from employees
where RANK() OVER (ORDER BY salary desc) <= 5
order by rnk;

Of course I cannot use analytical function in wher WHERE clause. But error message is not saying this but:

{    
"env": {        
"defaultTimeZone": "Z"   
 },    
 "items": []
 }

If I run this query as a script - the error message is fine:

*Cause:    Window functions are allowed only in the SELECT list of a query.
          And, window function cannot be an argument to another window or group
          function.
*Action:
More Details :
https://docs.oracle.com/error-help/db/ora-30483/
This post has been answered by thatJeffSmith-Oracle on Apr 21 2026
Jump to Answer
Comments
Post Details
Added on Apr 21 2026
1 comment
129 views