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...

Write a query to delete duplicate records in SQL SERVER

Answer Posted / saurabh dixit

DECLARE @people TABLE
(
name VARCHAR(32),
age INT
)
insert into @people
select Name,age From People group by Name,Age having COUNT(name)>1

delete People from People pe
join @people p on pe.name=p.name and pe.age=p.age

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is dml command?

1018


Explain the difference between delete,drop and truncate in SQL Server?

1159


List the data types available in mssql?

1102


How to verify a login name with sqlcmd tool?

1265


What are “lost updates”?

1043


How to view existing indexes on an given table using sys.indexes?

1150


Data table as parameter in sql server?

1104


How ssrs maintain security?

1132


When cursors are useful?

1170


How to stop a loop early with break statements in ms sql server?

1073


How do you run a trace?

946


How do I completely remove sql server instance?

1151


what is the difference between count(*) and count(1) ?

1125


List some case manipulation functions in sql?

1090


What is the optimal disk configuration for a database server and what raid configurations would you use if budget is not a constraint?

1029