1. 程式人生 > >刪除重複記錄的SQL

刪除重複記錄的SQL

DELETE FROM [FLEET_ENGINE] WHERE ID IN (
SELECT
MIN(ID) AS ID
FROM [dbo].[FLEET_ENGINE] group by [FLEET_FK] ,[ENGINE_SERIAL_NUM] having count(1)>1));