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

Answer Posted / sushma

SELECT * from
(SELECT * FROM emp ORDER BY sal DESC)
WHERE rownum <= 2
MINUS
SELECT * from
(SELECT * FROM emp ORDER BY sal DESC)
WHERE rownum < 2

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how many ways we can we find the current date using mysql? : Sql dba

620


How do I run a pl sql program?

629


Is there a 64 bit version of ssms?

520


How do I view stored procedures?

547


What is sqlcontext?

553






What is the function that is used to transfer a pl/sql table log to a database table?

557


Where is all the data on the internet stored?

558


Mention what are different methods to trace the pl/sql code?

562


What is the difference between inner join and natural join?

513


what is the bond code in materialized view?

2491


What is sql trigger example?

543


What is the use of index in hive?

551


what are the advantages and disadvantages of cascading style sheets? : Sql dba

556


how does a local variable is defined using t-sql? : Transact sql

548


How do you remove duplicates without using distinct in sql?

506