很簡單通過id刪除
DELETE
FROM
table_nameASta
WHERE
ta.唯一鍵<>(
SELECT
t.maxid
FROM
(SELECTmax(tb.唯一鍵)ASmaxidFROMtable_nameAStbWHEREta.判斷重復的列=tb.判斷重復的列)t
);
很簡單通過id刪除
DELETE
FROM
table_nameASta
WHERE
ta.唯一鍵<>(
SELECT
t.maxid
FROM
(SELECTmax(tb.唯一鍵)ASmaxidFROMtable_nameAStbWHEREta.判斷重復的列=tb.判斷重復的列)t
);