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

Answer Posted / surajit pathak

select * from emp e1
where 2>(select count(1) from emp e2
where e2.sal>e1.sal)
order by sal desc

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the purpose of %type and %rowtype data types with the example?

546


Can we create index on primary key?

519


What is basic structure of pl sql?

492


What are sql procedures?

574


What is dense_rank?

530






Is truncate ddl or dml?

538


what is “go” in t-sql? : Transact sql

594


table structure: ---------------- col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10 01-mar-2012 11:12:46 01-mar-2012 11:11:23 Write a query to display the result as shown below: col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10

3325


What is trigger in pl sql?

553


What is embedded sql with example?

537


What is secondary key?

506


Does pl/sql support create command?

572


What do you mean by field in sql?

528


Explain lock escalation? : Transact sql

697


Where can I learn sql for free?

498