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/