Find the 4th Highest employee salary from the following table
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
It will take less than 1 minute to register for lifetime. Bonus Tip - We don't send OTP to your email id Make Sure to use your own email id for free books and giveaways
Answers ( 2 )
using limit (4,1) at the end of statement
SELECT Salary FROM (SELECT Salary FROM Employee ORDER BY salary DESC LIMIT 4)
SELECT salary
FROM (SELECT *, DENSE_RANK() OVER (ORDER BY SALARY DESC ) as r
FROM table_name )
WHERE r=4 ;