1.删除重复手机号的数据 这样写会出错。 delete from three_factors t2 where t2.id in(select min(t.id) from three_factors t group by t.phone having count(t.phone)>1) ; 3、问题解决 将SELECT出的结果再通过中间表SELECT一遍,这样就规避了错误。 delete from three_factors t2 where t2.id in (select s.* from (select min(t.id) from three_factors t group by t.phone having count(t.phone)>1) s);
mysql 删除重复数据
最新推荐文章于 2024-04-17 15:25:46 发布