Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to identify and flag duplicate rows based on single colu
Message
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
How to identify and flag duplicate rows based on single colu
Divers
Thread ID:
01053662
Message ID:
01053662
Vues:
54
I have a table that I need to identify duplicate entries based off the value of a single column, and delete all but one of the duplicate entry records.

Was hoping someone had a routine already for something like this. I found this example, but it doesn't work, gives error on the where (patientID,mpinumber) line:
delete from patients
  where (PatientID, mpinumber) 
    not in
    ( select min(PatientID), mpinumber
         from patients group by mpinumber)
Thanks

Kirk
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform