Delete duplicate rows from a table without primary key by
using a single query
Table Employee
empname salary
A 200
B 300
A 200
C 400
D 500
D 500
Output should be
A 200
B 300
C 400
D 500
Answer Posted / b.v.rajaram
delete top (select count(*)-(select count(distinct empname )
from Employee) from Employee)from Employee
where a in (select distinct a from Employee)
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How you can minimize the deadlock situation?
What is sql server management studio? : sql server management studio
What is filtered index?
What stored procedure would you use to view lock information?
Mention the differences between substr and charindex in sql server.
What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?
How you trouble shoot when any job fails
what is the difference between openrowset and openquery?
How many types of stored procedures are there in sql server?
Mention what are the different types of ssrs reports?
Explain the use of containers in ssis and also their types?
While you are inserting values into a table with the insert into .. Values option, does the order of the columns in the insert statement have to be the same as the order of the columns in the table?
How to get a list of columns in a view using the "sp_columns" stored procedure?
Can you explain what is indexed view? How to create it?
Explain how dts is used to extract, transform and consolidate data?