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 is compound operators?
What is change data capture (cdc) in sql server 2008?
What is it’s similarity with sql server?
What is a View ? Can we insert, Update and delete a view?
Is it possible to create trigger on views?
How to transfer an existing table from one schema to another schema in ms sql server?
Explain about builtinadministrator?
How you can get the list of largest tables in a database?
What is the difference between a clustered index and a non-clustered index?
What is Replication?
Can we add an identity column to decimal datatype?
What’s the use of custom fields in report?
how many type of indexing in database?
Tell me extended events in sql server 2008?
How is foreign key related to primary key?