编程爱好者之家
//查找caijikey重复的数据 SELECT * FROM ar_caiji WHERE caijikey IN(SELECT caijikey FROM ar_caiji GROUP BY caijikey HAVING COUNT(caijikey) > 1);
//删除重复记录只保留id最大的 delete from ar_caiji where id not in (select maxid from (select max(id) as maxid from ar_caiji group by caijikey) b);