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 / g
TO FIND THE 3rd,
select max(sal) from emptable where salary not in(select
distinct top 2 sal from emptable)
TO FIND THE 4th,
select max(sal) from emptable where salary not in(select
distinct top 3 sal from emptable)
TO FIND THE 5th,
select max(sal) from emptable where salary not in(select
distinct top 4 sal from emptable)
keep change top value...
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What are basics of policy management?
Explain raiserror in sql server?
Tell me what is sql profiler?
What is a covered index?
What is 'write-ahead log' in sql server 2000 ?
How does SSIS(Sql Server Integration Services) deffer from DTS(Data Transformation Services)?
do you know what is a deadlock and what is a live lock? How will you go about resolving deadlocks? : Sql server database administration
How to make conditional sum in ssrs?
What happens if we shrink log file in sql server?
What are the different types of normalization?
How ssrs maintain security?
How to move database physical files in ms sql server?
Explain the Ways to improve the performance of a sql azure database?
what is the difference between writing data to mirrored drives versus raid5 drives. : Sql server administration
What are the different Authentication modes in SQL Server and how can you change authentication mode?