Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

DBMS%20Interview%20Questions%20and%20Answers

Question: We have an employee salary table how do we find the second highest from it?
Answer:
Below Sql Query find the second highest salary:
SELECT * FROM wbEmployeeSalary a WHERE (2=(SELECT COUNT(DISTINCT(b.salary)) FROM wbEmployeeSalary b WHERE b.salary>=a.salary))
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook