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
When do we use triggers?
What is rename in sql?
What is dbo in sql?
What is set serveroutput on?
The in operator may be used if you know the exact value you want to return for at least one of the columns.
what is self-join? : Sql dba
How do I trace sql profiler?
What is the difference between left outer join and left join?
What are the different dcl commands in sql?
what are all the common sql function? : Sql dba
How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?
what are the authentication modes in sql server? : Sql dba
How do you optimize a query?
What are the two different parts of the pl/sql packages?
What are the different types of tables in sql?