- Query 1
SELECT DISTINCT(salary) FROM table_name tn1 WHERE (n-1) = (SELECT COUNT( DISTINCT( tn2.salary )) FROM table_name tn2 WHERE tn2.salary > tn1.salary
- Query 2
SELECT TOP 1 salary FROM (SELECT DISTINCT TOP n FROM table_name ORDER BY saalary DESC) tn ORDER BY salary
No comments:
Post a Comment