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
What is Difference Between Unique and Primary Key Constraints?
What is the command used to fetch the first 5 characters of a string?
How do I view stored procedures?
what are aggregate and scalar functions? : Sql dba
What is nvarchar in sql?
What is identity column in sql server?
What is the difference between nested table and varray?
What is cursor and why it is required?
What is trigger in sql and its types?
What is a recursive stored procedure?
Can we use having without group by in sql?
What is the difference between a primary key and a unique key?
What is mdb stand for?
How do you optimize a stored procedure query?
What are the disadvantages of not performing database normalization?