0 votes
1 view
in SQL by (36k points)

Can anyone tell me how to find the second highest salary in SQL?

1 Answer

0 votes
by (86.2k points)

The following is the query to find the second-highest salary of the employee in SQL. This is one of most frequently asked question in SQL interview and you can check out this blog on SQL interview questions for more such FAQs in the interview.

select e1.EmployeeName from Employee as e1

where 2 = (select count (*)

      from Employee e2

      where e2.salary >= e1.salary)

Related questions

0 votes
1 answer
0 votes
1 answer
asked Apr 20 in SQL by Sudhir_1997 (36k points)
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...