Query for second maximum salary in each in each department

Answer Posted / suneelkumar

select * from emp x where 2=(select count(distinct sal) from
emp y where x.sal<=y.sal) group by deptno;

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is postgresql a server?

578


How do you identify a primary key?

635


What are the constraints available in sql?

583


How many sql commands are there?

677


what are the t string functions available in tsql? : Transact sql

545






Why use triggers in sql?

510


How to start oracle sql developer?

564


What are the indexing methods?

582


Is left join and outer join same?

552


how to include comments in sql statements? : Sql dba

547


What is indexing oracle sql?

566


What is the difference between left outer join and left join?

522


What is sql entity?

534


how can you create an empty table from an existing table? : Sql dba

665


Can we declare a column having number data type and its scale is larger than pricesionex: column_name number(10,100),column_name numbaer(10,-84)

542