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
How you can get a list of all the table constraints in a database?
Explain acid?
Explain about integration services of Microsoft SQL server?
What are database states in ms sql server?
Explain the creation and execution of a user-defined function in the sql server?
Describe in brief system database.
Is it possible to have clustered index on separate drive from original table location?
What is side by side migration in sql server?
What are the steps to take to improve performance of a poor performing query? : sql server database administration
How can you know if the row fetched from cursor is still valid in underlying table?
How can you fetch alternate records from a table?
What is the purpose of a table?
What is "scheduled jobs" or "scheduled tasks"?
What is lookup override?
Can you always create a cache of a report?