Answers

Question and Answer:

  Home  SQL Oracle

⟩ How to find out nth highest salary from emp table?

SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM EMP B WHERE a.sal<=b.sal);

For Eg:-

Enter value for n: 2

SAL

---------

3700

 187 views

More Questions for you: