SQL queries to find 2nd highest salary from the table
Anonymous
Using normal group by along with Sub Query: Select the Max( Salary) from Employee where Salary NOT in (select Max(Salary) from Employee) Using Window Function: You can use Rank function to rank the salaries in descending and then use CTE to filter the one with Rank = 2 (This can work for any Nth Rank)
Check out your Company Bowl for anonymous work chats.