Question: Check which subject is among the top 3 scoring subjects for Rahul in Term-1 and Term-2 using mssql?
If I use order by before intersect the code is not working. But if I don't sort data of both the tables in descending order individually then top 3 selection would be wrong.
Please help
My approach: select top 3 subject from RESULT where exam=‘Term_1’ Order by marks desc intersect select top 3 subject from RESULT where exam=‘Term_2’ Order by marks desc