1. How to fetch all the duplicate records from the table.
2. How to fetch the second highest salary from the table.
Answer Posted / saradhi
How to fetch the second highest salary from the table.
SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP n salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary
where n > 1 (n is always greater than one)
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How do I make a resultset scrollable?
What are the different authentication modes in sql server? How can it be changed?
How retrieve field names from the table in SQL through JAVA code?
How can sql injection be stopped? : sql server security
Tell me about joins in database system and explain each in detail.
Explain a join?
Explain the use of containers in ssis?
how many triggers you can have on a table? : Sql server database administration
What stored by the model? : sql server database administration
How to achieve Paging of records in SQL SERVER?
How to connect sql server management studio express to sql server 2005 express?
What are the disadvantages of using querystrings to send data from one page to another?
Explain what is sql server english query?
What are types of scd? : sql server analysis services, ssas
What is the tcp/ip port on which sql server runs?