Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to identify and flag duplicate rows based on single colu
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
How to identify and flag duplicate rows based on single colu
Miscellaneous
Thread ID:
01053662
Message ID:
01053662
Views:
53
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
Next
Reply
Map
View

Click here to load this message in the networking platform