How to delete all duplicate records with MIN (Id) and keep Max(Id) record
Yet another solution:
DELETE FROM StockInformation WHERE Id < ( SELECT MAX(Id) FROM StockInformation AS csq WHERE csq.ItemId = StockInformation.ItemId AND csq.StockTypeUserId = StockInformation.StockTypeUserId )
No comments:
Post a Comment