Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete duplicate records
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00596573
Message ID:
00596685
Vues:
16
>I have a table from a client that never got a primary key put on the id field. There are 700 duplicate records where every field including id is duped. Is there any automatic way to rid these so that I can define a primary key on this id field? I know how to get a list of the dupes.
>
>Does adding an idx primary key field with seed 1 step 1 help?

How about:

delete from table_name where pk_column in (select pk_column from
table_name group by pk_column having count(*)>1);


Works on Oracle but maybe the sql server syntax is different?

HTH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform