Query for second maximum salary in each in each department
Answer Posted / akula
select * from emp e1 where 2 =(select count(distinct(sal)) from emp e2 where e1.dno=e2.dno and e1.sal<=e2.sal);
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Can you have more than one key in a database?
Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me
What are the different types of triggers?
Explain the difference between rename and alias?
what is the command used to fetch first 5 characters of the string? : Sql dba
How do I save a stored procedure?
Are stored procedures faster than queries?
How to add a column ‘salary’ to a table employee_details?
What is the difference between row level and statement level trigger?
Whis is not false in primary key?
What is the file extension for sql database?
If the application is running very slow? At what points you need to go about the database in order to improve the performance?
Is coalesce faster than isnull?
How do I remove all records from a table?
What is an escape character in sql?