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

How to download and install microsoft .net framework version 2.0?

1130


Can we call future method from queueable?

1036


How can you tell if a database object is invalid?

1067


What are the new features in SQL Server 2005 when compared to SQL Server 2000?

1153


What is the use of builtinadministrators group in sql server? : sql server security

1034


What is tablix?

162


Does full backup break log chain?

955


What are the key configuration files for sql server reporting services ?

167


What is local temp table?

943


How do I create a trace in sql server?

1023


How to find out the list schema name and table name for the database?

931


Tell me what is sql profiler?

1020


Which autogrowth database setting is good?

1051


How to create a local temporary stored procedure?

995


Which operator do you use to return all of the rows from one query except rows are returned in a second query?

982