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

What is save transaction and save point?

1256


you added a row to a view, but the row is not shown on the view. Explain how this can happen, and how you can remedy the situation

997


How do you manipulate data?

949


Explain datetime2 data type in sal server 2008?

951


How to invoke a trigger on demand?

1150


What is the difference between index seek vs. Index scan?

1063


What do you mean by data manipulation language?

1063


Which language rdl files made of?

141


Explain powershell included in sql server 2008?

1114


what is difference between view and Dip.

2456


How many columns can we include on clustered index ?

1058


To automatically record the time on which the data was modified in a table, which data type should you choose for the column?

1004


Recommend an approach to ensuring that all changes in the remote databases synchronize with the SQL Azure database?

128


After creating the cube, if we added a new column to the oltp table then how you add this new attribute to the cube? : sql server analysis services, ssas

1009


What are examples of triggers?

1125