select * from table_a where id in (select min(id) from table_a group by a)
select * from altals where id in (select min(id) from altals group by SUBSTRING_INDEX(cids,‘,‘,1))
SUBSTRING_INDEX(cids,‘,‘,1))截取字符串
group by 按照什么分组
select min(id) from table_a group by a 根据a来分组找出最小的id
原文:https://www.cnblogs.com/codezhao/p/11145402.html