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 / sarat
TO FIND THE Nth HIGHEST SAL IN EMP TABLE
SELECT MIN (salary) as NthSalary FROM emptable WHERE
salary IN ( SELECT DISCINCT TOP N salary FROM emptable
ORDER BY salary DESC )
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
How important do you consider cursors or while loops for a transactional database?
What is the difference between a local and a global temporary table?
Is sql server 2016 free?
What do you mean by cardinality?
What is exclusive locks?
Do you know what is fill factor and pad index?
What is the difference between sql server 2000 object owner and sql server 2005 schema? : sql server database administration
What is transaction server isolation?
What is the new security features added in sql server 2016? : sql server security
What is the xml datatype?
Is it possible to run multiple publications and different type of publications from the same distribution database? : sql server replication
What is the impact on other user sessions when creating indexes?
Write a sql query to delete duplicate records from a table called table1
Can we use where clause with group by?
What is sql server schema compare? How we can compare two database schemas?