how to find the second highest salary from emp table?

Answer Posted / vikas

select top 1 salary from emp
where salary in (select top 2 salary from emp order by salary desc)order by salary

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the benefits of triggers?

606


Explian rowid, rownum? What are the psoducolumns we have?

576


What do you mean by stored procedures? How do we use it?

529


Difference between global and parameter variables?

1462


What is the purpose of cursors in pl/sql?

638






What are the commands used in sql?

531


What is asqueryable?

533


What are sql ddl commands?

552


How many disk partitions should I have?

555


Why are cursors used?

585


Can a table contain multiple primary key’s?

631


what is sub-query? : Transact sql

599


What are different functions in sql?

521


What is query syntax?

523


What are the two different parts of the pl/sql packages?

568