标签:src nbsp rom mysq 重复数据 tab sel mysql having
DELETE FROM table WHERE id IN ( SELECT src.id FROM ( SELECT t1.id FROM table t1 WHERE ( t1.col1, t1.col2, t1.col3, t1.col4, t1.col5 ) IN ( SELECT col1, col2, col3, col4, col5 FROM table GROUP BY col1, col2, col3, col4, col5 HAVING count(*) > 1 ) AND t1.id NOT IN ( SELECT MAX(id) FROM table GROUP BY col1, col2, col3, col4, col5 HAVING count(*) > 1 ) ) src );
标签:src nbsp rom mysq 重复数据 tab sel mysql having
原文地址:https://www.cnblogs.com/jason123/p/9753951.html