How to delete duplicate records from a table?(for suppose in
a table we have 1000 Records in that we have 200 duplicate
Records , so ,how to findout that duplicate Records , how to
delete those Records and arranged into sequence order? one
more thing that there is no primary key at all)
Answer Posted / pooja narang
We will get the duplicate records and insert them into a
new temp table by using below query:
select * into tmp_Employee
from Employee
having count(distinct *) > 1
Now delete the duplicate records from Employee table:
delete from Employee
having count(distinct *) > 1
Now insert the records from tmp_Employee to Employee table:
insert into Employee
select * from tmp_employee
drop table tmp_employee
Is This Answer Correct ? | 4 Yes | 15 No |
Post New Answer View All Answers
How to deploy the Report?
Explain can you implement data mining in ssrs?
What is pivot and unpivot?
Your table has a large character field there are queries that use this field in their search clause what should you do?
Do you know exporting and importing utility?
Why use update_statistics command in sql server?
What is serializable?
What changes in the front end code is needed if mirroring is implemented for the high availability? : sql server database administration
How to encrypt Strored Procedure in SQL SERVER?
How to execute a sql statement using odbc_exec()?
How to test odbc dsn connection settings?
How to remove duplicate rows from table?
List the types of recovery model available in sql server?
Explain aggregate functions?
what are user defined datatypes? : Sql server database administration