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
What are approximate numeric data types in ms sql server?
Do you know how to make remote connection in database?
Your company has 50 branches all over the country all the branches, including the head office have sql server as the database every night all 50 branches upload certain information to the head office which replication topology is best suited for the above scenario?
Mention the different types of triggers?
What are drilldown reports?
Explain log shipping and mention its advantages.
how you can configure a running aggregate in SSRS?
What is self contained multi valued query?
How do you debug a procedure in sql server?
What is 1nf 2nf and 3nf?
How to find table changes in sql server?
Is truncate autocommit?
Does sql server 2000 clustering support load balancing?
Explain in brief about Microsoft SQL server?
Name 3 of the features that the sql server built-in function loginproperty performs on standard logins? : sql server security