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

What is type and rowtype in pl sql?

541


Why do we use sqlite?

537


What are sql constraints?

568


What is coalesce sql?

518


Enlist some predefined exceptions?

588






Hi how to import oracle sequence in Informatica? Please write stored procedure code that will import oracle sequence in Informatica SP transformation as per below scenario Oracle table product list Pro_id, pro_name 101, LED Lights. 102, 20watt CFL Lights. 103, 30 watt CFL lights Now a new flat file with new product list needs to be added to oracle table product list with oracle sequence. flat file product Prono,pro_name, 1, 20 watt tube light 2, 30 watt tube light & target should be like 101, LED Lights. 102, 20watt CFL Lights. 103, 30 watt CFL lights. 104, 20 watt tube light 105, 30 watt tube light thks reg suvarna joshi suvarnaatsuvarna@rediffmail.com

2074


What are records give examples?

569


How do I find duplicates in a single column in sql?

540


What is rank () in sql?

536


what is online transaction processing (oltp)? : Sql dba

531


How can a function retun more than one value in oracle with proper example?

590


how to create a test table in your mysql server? : Sql dba

500


What are the usages of sql?

567


How much does a sql dba make? : SQL DBA

512


What is the meaning of disabling a trigger?

649