查詢student表中手機號重復數據select id,uid,mobile,count(*) as count from student group by mobile having count>1; 查詢student表中id最小的重復數據select max(id) from student group by uid having count(uid) > 1刪除student表中重復的id最小的數據delete from student where id in (select minid from (select min(id) as minid from student group by mobile having count(mobile) > 1) as b);