how to find the second highest salary from emp table?

Answer Posted / arun

select distinct (a.salary) from employees a
where &N = (select count (distinct(b.salary))
from employees b where a.salary <= b.salary);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is data stored in sql?

560


How we can update the view?

607


What is output spooling in sql*plus?

564


Is ms sql is free?

540


What is database migration?

523






What is dynamic sql in pl sql?

507


what is table? : Sql dba

576


how to get a list of indexes of an existing table? : Sql dba

528


How do you use a while loop in pl sql?

547


what are the authentication modes in sql server? How can it be changed? : Sql dba

712


What is normalisation and its types?

558


Explain the the delete statements in sql?

585


How do I run a sql query in pgadmin 4?

556


Which table is left in left join?

541


what are all the different normalizations? : Sql dba

515