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
Is sql database free?
What is the usage of the distinct keyword?
What is full join?
what is a join? : Sql dba
What are the two types of exceptions in pl/sql?
How many triggers can be applied on a table?
What are stuff and replace function?
What is the difference between sum and count in sql?
explain advantages of myisam over innodb? : Sql dba
How consistent is the view of the data between and within multiple sessions, transactions or statements ?
Can we debug stored procedure?
What is rollback?
Can we use pl sql in sql server?
What is oracle sql called?
explain about mysql and its features. : Sql dba