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 / sagun sawant

Name Age
chandran 23
ranjith 24
chandran 23

To delete one of the duplicate records use following query

(For sql server 2000)

Set rowcount 1
delete from [tableName] order by name
set rowcount 0
--Write a cursor to delete multiple duplicate records
Or (In sql server 2005)

;with DelDup as (select row_number() over (partition by
sname order by sname) as RONO ,sname from [TableName])
Delete from DelDup where RONO > 1

Is This Answer Correct ?    29 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe how to use linked server?

1076


Find first and last day of current month in sql server

1080


How to name query output columns in ms sql server?

1014


What is the difference between for xml raw and for xml auto?

1080


Explain how to send email from sql database?

1106


What the class forname () does?

1139


How to use old values to define new values in update statements in ms sql server?

1330


Explain the disadvantages/limitation of the cursor?

1006


What command is used to delete a table from the database in the sql server and how?

1187


Explain indexed views?

1027


What is log cache in sql server?

1097


What are the joins in sql server? : sql server database administration

1050


What is the difference between web edition and business edition?

113


What is an example of a primary key?

1037


How to create prepared statements using odbc_prepare()?

1101