Hibernate / SQL
SQL to find 2nd highest salary in the Employee table.
One of the ways is to use correlated subquery to find the Nth highest salary as shown below.
In the above query, the 'N' may be replaced with 2 to find the second highest salary. Also for the top 2 salaries, replace the condition N-1= with N-1>=.
More Related questions...