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
List types of tables in SQL Azure?
What is user defined stored procedures?
How to achieve Paging of records in SQL SERVER?
What are the restrictions while creating batches in sql server?
What are the types of sql server?
Can a database be shrunk with users active?
Can we use where clause in union?
What is a fan-out query in SQL Azure?
What is the security principal at the server level that represents your session?
What is the stuff?
Can we take the full database backup in log shipping?
How to fine-tune reports?
How to create a ddl trigger using "create trigger" statements?
Where is my database stored on the hard disk in ms sql server?
How dts is used to extract, transform and consolidate data?