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 blob? : Sql dba
Table A Table B 1 1 2 1 3 1. Union & union all --> A Union B , A Union all B 2. Minus , Intersect --> A minus B , B Minus A , A Intersect B 3. Joins A join B , A Left Join B A Right Join B , A full Join B 4. %Type - Uses & Benifit 5. Truncate & Delete 6. Pragma Autonomus Transaction 7. how to Perform DDL from function or procedure 8. Can we have DML inside Function 9. Rank & Dense Rank diffrence 10. Water Mark in Oracle 11. Index , Can we have index in all column of table if no then why ?
what is myisam? : Sql dba
How do I order columns in sql?
Can we use join in subquery?
How many types of tables are there?
Why is a trigger used?
what is datawarehouse? : Sql dba
What is a temporal data type?
Why do we need a foreign key?
How do you go back in sql?
What is procedure and function in sql?
Does a join table need a primary key?
what is primary key? : Sql dba
What is sql profiler in oracle?