/ Published in: SQL
Expand |
Embed | Plain Text
-- Deletes duplicates (leaving one instance) where the table has a primary key DELETE FROM [TableName] WHERE [Id] NOT IN ( SELECT MAX([Id]) FROM [TableName] GROUP BY [DuplicateColumName1], [DuplicateColumName2] )
You need to login to post a comment.
