how to find the second highest salary from emp table?

Answer Posted / abhishek jaiswal

select salary from employees a where &nth_highest_salary =(select count(distinct salary)
from employees b where a.salary<=b.salary)
/

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does view contain data?

622


Can we connect to postgresql using sql developer?

491


how to return query output in html format? : Sql dba

657


name 3 ways to get an accurate count of the number of records in a table? : Sql dba

574


What is the difference between clustered and non-clustered index in sql?

527






What is union, minus and interact commands?

750


What are the differences between implicit and explicit cursors?

526


What are stuff and replace function?

578


How do I edit a trigger in sql developer?

545


Which sorts rows in sql?

589


What does pl sql stand for?

661


Is there a way to automate sql execution from the command-line, batch job or shell script?

560


What is sql query optimization?

551


What is cartesian join in sql?

563


Differentiate between syntax and runtime errors.

644