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 many database files are there in sql server 2000?what are they?
When should you use an instead of trigger?
What are date and time data types in ms sql server?
Do you know the cursor types?
Does the unique constraint create an index?
What is meant by datasource?
How to use clusters?
is it important for a database administrator to understand the operating system and file access? : Sql server administration
How to implement one-to-one, one-to-many and many-to-many relationships while designing tables?
How to get all stored procedures in sql server?
Explain the categories of stored procedure i.e. System stored procedure, local stored procedure, temporary stored procedure, extended stored procedure, remote stored procedure?
Define msdb database?
How many types of database relationship in sql server?
How to update multiple rows with one update statement in ms sql server?
What are information schema views?