Answer Posted / meher
SELECT SAL FROM EMP A WHERE &N= (SELECT COUNT(DISTINCT) SAL
FROM EMP B WHERE A.SAL<B.SAL)
--Pass the value for N as 2 to get 3rd highest salary.
--pass 0 for highest sal,1 for 2nd highest,2 for 3rd
highest and so on....
| Is This Answer Correct ? | 6 Yes | 6 No |
Post New Answer View All Answers
What does partition by mean in sql?
what is the different between now() and current_date()? : Sql dba
What is a pdo connection?
What do you mean by stored procedures? How do we use it?
Compare sql & pl/sql
Explain aggregate functions are available there in sql?
What is a ddl command?
Can we use the cursor's to create the collection in PL/SQL?
What is the difference between subquery and correlated query?
What does cursor do in sql?
What is the advantage of nosql?
How show all rows in sql?
What is use of trigger?
what is the use of anchoring object? what r the difference between anchoring object & enclosing object? can any one tell me all the details?
What is a primary key sql?