Simply add an extra condition then:
DELETE FROM StockInformation
WHERE Id < (
SELECT MAX(Id)
FROM StockInformation AS csq
WHERE csq.ItemId = StockInformation.ItemId
AND csq.StockTypeUserId = StockInformation.StockTypeUserId
) OR StockTypeUserID = 27
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles
No comments:
Post a Comment