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 / shashank shrivastava

Table-admin
------------------
adminID adminName
1 admin
2 tester
3 admin

SQL:
---------------
DELETE admin.* FROM admin,
(SELECT count(adminName) as c, MAX(adminID) as m from
admin GROUP BY adminName HAVING c>1) as new_admin
WHERE admin.adminID=new_admin.m

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How you can change the database name in SQL SERVER?

1192


What are sql servers used for?

1047


Where to find ntwdblib.dll version 2000.80.194.0?

962


What happens if strings are casted into wrong code pages in ms sql server?

1113


What are the different types of collation sensitivity?

1121


How to start and end transact-sql statements?

1028


What is the full meaning of dml?

952


How do I find the sql server version?

1025


What is an execution plan? How would you view the execution plan?

1077


How to insert multiple rows with one insert statement in ms sql server?

1122


How to use subqueries in the from clause in ms sql server?

1162


what is nonclustered index

959


How do you open a cluster administrator?

1051


How to run queries with sql server management studio express?

1092


What are the new scripting capabilities of ssms? : sql server management studio

1067