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
Why do we use %rowtype & %type in plsql?
What is execution plan in sql?
Why select is used in sql?
Should I use mbr or gpt?
What is %s in sql?
What are sql commands?
Can we update views in sql?
How do you optimize a stored procedure query?
what are the authentication modes in sql server? How can it be changed? : Sql dba
What is row_number () in sql?
What are tables and fields?
Is keyword pl sql?
What do you understand by pl/sql cursors?
What does joining a thread mean?
What do you know by pl/sql cursors?