How to find the second largest salary in the emp database and
also How to find 3rd,4th and so on ........ in the emp database
plz mail the answer @ mak2786@gmail.com
Answer Posted / s n yagneswara babu
TO FIND THE SECOND HIGHEST SAL IN EMP TABLE
select max(sal) from emp where sal not in(select max(sal)
from emp)
TO FIND THE 3RD HIGHEST SAL IN EMP TABLE
select max(sal) from emp where sal not in(select distinct
top 2 sal from emp order by sal desc)
TO FIND THE Nth HIGHEST SAL IN EMP TABLE
select max(sal) from emp where sal not in(select distinct
top N-1 sal from emp order by sal desc)
yagneswara babu
yagnesh_sn@yahoo.co.in
Is This Answer Correct ? | 39 Yes | 6 No |
Post New Answer View All Answers
Define full outer join?
Explain “not null constraint” in sql server?
What is the purpose of a table?
What is trigger in salesforce?
Why you need indexing? Where that is stored and what you mean by schema object? For what purpose we are using view?
How do I find the sql server database version?
After creating the cube, if we added a new column to the oltp table then how you add this new attribute to the cube? : sql server analysis services, ssas
which backup strategy you are following at ur company
Can we run Reporting Services with SQL Server express edition, which is a free version of SQL Server?
Explain can you implement data mining in ssrs?
List the data types available in mssql?
Explain the difference between control flow and data flow?
What is advantage data architect?
What is the difference between mysql and sql server?
Explain what stored procedure sp_replcounters is used for? : sql server replication