Write a query to get 2nd maximum salary in an employee table ?

Answer Posted / sohail

select empno,ename,sal
from (select ename,empno,sal,dense_rank()
over(order by sal desc)topn
from emp)
where topn=2

Is This Answer Correct ?    69 Yes 46 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the non-clustered index in sql?

589


What is the difference between join and natural join?

475


Why self join is used in sql?

499


what is the difference between $message and $$message? : Sql dba

550


What is a sql trace file?

550






How to call shell script from pl sql procedure?

625


Explain raise_application_error.

644


What is sql injection vulnerability?

494


Is a secondary key the same as a foreign key?

492


how many values can the set function of mysql take? : Sql dba

534


What is the purpose of primary key?

535


Which are the different character-manipulation functions in sql?

550


what are rollup and cube in t-sql? : Transact sql

661


what is top in tsql? : Transact sql

547


How do I view tables in sql developer?

517