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
Can you pass expressions to function parameters?
Explain what is meant by replication of database?
What is default port number for sql server 2000?
Is oracle faster than sql server?
How to create a view with data from multiple tables?
How many columns can exist together per table?
Do you know what are the restrictions that views have to follow?
What does set rowcount do?
What is the use of =,==,=== operators?
How can you insert null values in a column while inserting the data?
How to optimize stored procedure optimization?
What is acid mean in sql server?
What is raiseerror? What is raiseerror?
Difference between primary key and clustered index?
How can delete duplicate records in cte in sql server?