How to find out nth highest salary from emp table?
Submitted by: AdministratorSELECT 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
Submitted by: Administrator
For Eg:-
Enter value for n: 2
SAL
---------
3700
Submitted by: Administrator
Read Online Oracle SQL Job Interview Questions And Answers
Top Oracle SQL Questions
☺ | Explain Difference between an implicit and an explicit cursor? |
☺ | Explain What is difference between SUBSTR and INSTR? |
☺ | Explain What are various joins used while writing SUBQUERIES? |
☺ | Explain Difference between procedure and function.? |
☺ | Explain What is an UTL_FILE.What are different procedures and functions associated with it? |
Top DB Oracle Categories
☺ | Oracle PL-SQL Interview Questions. |
☺ | Oracle DBA Interview Questions. |
☺ | Oracle D2K Interview Questions. |
☺ | OCI Interview Questions. |
☺ | Oracle RMAN Interview Questions. |