Select Nth Highest Salary

 

  1. select min(salary) from   
  2. (select distinct salary from emp order by salary desc)   
  3. where rownum < 3;  
  1. In order to calculate the second highest salary use rownum < 3  
  2. In order to calculate the third highest salary use rownum < 4  

Comments

Popular posts from this blog

Java 8 : Find the number starts with 1 from a list of integers

How to prevent Singleton Class from Reflection and Serialization

Optional Vs Null Check