Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

DBMS Interview Questions and Answers

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