I hope you can help me with my homework :)
We need to build a query that outputs the top N best paid employees.
My version works perfectly fine. For exam
When you use count(distinct ), equal ranking top salaries will be treated as tie ranks.
count(distinct )
select NAME, SALARY from STAFF STAFF1 where 3 >= ( select count(distinct STAFF2.SALARY) RANK from STAFF STAFF2 where STAFF2.SALARY >= STAFF1.SALARY)