Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Define union, union all, minus, intersect?

979


How to loop through the result set with @@fetch_status?

1349


What is the difference between push and pull subscription? : sql server replication

1216


What is cached report?

143


Can binary strings be used in arithmetical operations?

937


What are the tool windows in sql server management studio? : sql server management studio

1078


How to return the date part only from a sql server datetime datatype?

1103


What happens if you add a new index to large table?

942


What is the main difference between ‘between’ and ‘in’ condition operators?

1191


How can I track the changes or identify the latest insert-update-delete from a table?

964


What is a non-clustered index?

998


Write an sql query to find first weekday of the month?

919


I applied Transactional with updatable subscriptions replication on 2 tables now i want to delete those 2 tables but i cannot delete those tables as replication is running how can i stop replication for those 2 tables(but i don't want to delete those replicated tables but i need to stop the replication) how can i do that

2026


How to modify an existing user defined function?

1107


How to create user messages with print statements in ms sql server?

989