Skip to content
Advertisement

ORA-00920: invalid relational operator while using IN operator

I have a table col where i have:

enter image description here

I returned some data using query by year wise ans dept_id wise:

The data I got was:

enter image description here

Here there is no problem as my sql is running right.So, I needed to extract all the information of col table,So I used subquery as:

But,I got error as:

i searched this error at other pages also,but I found them as bracket misplace error.But in my case,I dont know what is happening here?

Advertisement

Answer

Instead of aggregating, you can filter with a correlated subquery:

An index on (dept_id, year, marks) would speed up this query.

Another option is to use window function row_number():


If you do want to stick to aggregation, then you can join your subquery with the original table as follows:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement