1. How to fetch all the duplicate records from the table.
2. How to fetch the second highest salary from the table.
Answer Posted / amit kumar
(1) Query to fetch 2'nd highest salary:
Select max(sal) from emptable where sal not in (Select
max(sal) from emptable)
(2) How to fetch all the duplicate records from the table.
SELECT COUNT(*), <COLUMN_NAME> FROM EDUCATION GROUP BY
<COLUMN_NAME>
Is This Answer Correct ? | 10 Yes | 9 No |
Post New Answer View All Answers
Can primary key be a foreign key?
What is dbcc updateusage?
Explain isolation levels that sql server supports?
What is check constraint in sql server?
What is a covering index?
What are unicode character string data types in ms sql server?
Explain partitioned view?
What is merge statement?
What does REVERT do in SQL Server 2005?
What is pessimistic concurrency?
Explain nested stored procedure. Syntax and an example for create nested stored procedure?
What is dbcc?
Can a stored procedure call itself or a recursive stored procedure? How many levels of sp nesting is possible?
What is store procedure? How do they work?
what are the new features introduced in sql server 2000? : Sql server database administration