Write a query to get 2nd maximum salary in an employee table ?
Answer Posted / veera
SELECT * FROM EMP A WHERE &N-1=(SELECT COUNT(DISTINCT SAL) FROM EMP B WHERE A.SAL<B.SAL) ORDER BY SAL
Pass Paramenter :2..it will give the 2nd maximum salary
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is a full join?
How would you reference column values before and after you have inserted and deleted triggers?
what is rdbms? : Sql dba
Why primary key is required?
How do you create a db file?
What does select * from mean in sql?
How to check if a column is nullable before setting to nullable?
Can we use insert statement in function?
how do you login to mysql using unix shell? : Sql dba
What type of database is sql?
How do I upgrade sql?
What are triggers in sql?
Where is sql database stored?
Are views faster than queries?
What is the size of partition table?