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 create a new table in a given schema?

1255


How to delete a login name in ms sql server?

1127


Write a program using SQL queries to find a unique entry in a table.

1046


If a stored procedure is taking a table data type, how it looks?

6521


Equi join and non equi join is possible with sql server?

1096


Where sql server user names and passwords are stored in sql server? : sql server database administration

1103


What is normalization and its types?

1077


what are the critical issues you have resloved in your company

2016


Can you please differentiate between a primary key and a unique key?

1050


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

1031


What are the diifferences between the ms sql server vs mysql?

1237


How to Insert multiple rows with a single insert statement?

1100


you want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition? : Sql server administration

1160


What are the steps to insert a table?

992


What is bulkcopy in sql?

998