1. How to fetch all the duplicate records from the table.
2. How to fetch the second highest salary from the table.
Answer Posted / rajkumar v
Ans:1
select Column_Name from Table_Name group by Column_Name
having count(Column_Name )>1
Ans:2
salary - column name
SELECT TOP 1 salary FROM (SELECT DISTINCT TOP 2 salary FROM
Table_Name ORDER BY salary DESC) A ORDER BY salary
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What does normalization do to data?
What is SQL Azure Firewall?
What are the different methods available under sqlcommand class to access the data?
What are the events recorded in a transaction log?
Tell me what are the advantages of using stored procedures?
Can we insert data into a view?
Is port 1433 secure?
How to filter records of table in SQL SERVER?
How adventureworkslt tables are related?
What is the difference between locking and multi-versioning?
What is query processing?
what is the difference between delete table and truncate table commands? : Sql server database administration
How to list all user defined functions in the current database?
What is sql server 2000 work load governor?
To which devices can a backup be created and where should these devices be located? : sql server management studio