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
Explain the purpose of indexes?
Define left outer join in sql server joins?
It is important form e to get the information from log files of applications executed by the task scheduler? Does sql studio save these log files? : sql server management studio
What is the difference between dropping a database and taking a database offline?
How do I start sql server?
Explain the difference between HTTP and HTTPS in database?
how would you store your query in an SSRS report or a Database server?
What are “phantom rows”?
Can sql servers link to other servers?
How do you clear a log file?
What is coalesce in sql server?
What are drilldown reports?
Every night you run a full backup after every 3 three hours you make a differential backup every hour you make an incremental backup in a worst-case scenario, how much work you can lose?
What is sql server schema compare? How we can compare two database schemas?
Are there issues when exporting SSRS reports into Microsoft Excel? When my users are trying to export a SSRS report into Microsoft Excel, one or two columns in the report appear to merge together. Why might this be?