mysql根据两个字段判断重复的数据并且删除,只保留一条。
DELETE from table
where id Not IN
(select id from
(select MIN(id) as id,count(列1) as count from table
GROUP BY 列1,date
HAVING count(列1)>1) as temp);
SELECT count(*),列1,列2,列3 from table
GROUP BY 列1,列2,列3 having count(*) > 1;