select * from table_a where id in (select min(id) from table_a group by a) )) SUBSTRING_INDEX(cids,',',1))截取字符串 group by 按照什么分组 select min(id) from table_a group by a 根据a来分组找出最小的id…
1.查询表中重复数据.select * from peoplewhere peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)2.删除表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断,只留有rowid最小的记录delete from people where peopleId in (select peopleId…