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 a pl/sql block?

591


How would you convert date into julian date format?

590


Explain the uses of control file.

615


What is case function?

596


What is a dynamic query?

569






Is vs as in pl sql?

489


What is rtm in testing?

572


How can a pl sql block be executed?

528


What is the example of procedure?

521


What is partition in sql query?

516


Can we insert data into view?

525


what are the drivers in mysql? : Sql dba

552


Is id a reserved word in sql?

656


Why should I use postgresql?

561


How to get unique records from a table?

521