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 built-in/administrator?
How to connect ms access to sql servers through odbc?
What is the difference between sdf and mdf?
What is the New in SQL server 2008?
What are the purpose of Normalisation?
What is primary key index?
Suppose you want to implement the following relationships while designing tables. How would you do it?a.) One-to-oneb.) One-to-manyc.) Many-to-many
 Explain what is sql override for a source taLle in a mapping?
What to check if a User database is locked?
Can two tables share a primary key?
what are the different stages of Report Processing?
What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?
If you are given access to a SQL Server, how do you find if the SQL Instance is a named instance or a default instance?
What are horizontal and vertical scaling?
How can we delete Duplicate row in table?