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
Write a program using SQL queries to find a unique entry in a table.
Explain the working of sql privileges?
What is the maximum size per database for sql server express?
What the class forname () does?
Explain the different types of joins?
How is a full-text index updated?
How to install sql server 2005 express edition?
What is stored in the mssqlsystemresource database? : sql server database administration
what are constraints? Explain different types of constraints? : Sql server database administration
Which are the new data types introduced in sql server 2008?
Explain Reporting Life Cycle?
How can we use ConnectorJ JDBC Driver with MS SQL?
Explain difference between control flow and data flow?
what is new philosophy for database devises for sql server 7.0? : Sql server database administration
How can we get count of the number of records in a table?