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
What is the benefit of normalization?
Do you know what are various aggregate functions that are available?
What are the properties of the relational tables?
How to check status of stored procedure in sql server?
How can i Relate Tables in SSIS
What is ssl in sql server?
List the types of recovery model available in sql server?
How to get all stored procedures in sql server?
what do you understand by change data capture?
whats the maximum size of view state??
Do you know what are the differences between lost updates and uncommitted dependencies?
Is it possible to call a stored procedure within a stored procedure?
What are the advantages of mirroring?
What is the importance of concurrency control?
Define the one-to-one relationship while designing tables.