Find the 4th Highest employee salary from the following table

Question

Find the 4th highest salary from the given employee table

in progress 0
sirajp99 55 years 2 Answers 1367 views Newbie 0

Answers ( 2 )

  1. using limit (4,1) at the end of statement
    SELECT Salary FROM (SELECT Salary FROM Employee ORDER BY salary DESC LIMIT 4)

  2. SELECT salary
    FROM (SELECT *, DENSE_RANK() OVER (ORDER BY SALARY DESC ) as r
    FROM table_name )
    WHERE r=4 ;

Leave an answer

Browse
Browse