mysql中重复数据只取条
时间:2019-07-07 13:49:16
收藏:0
阅读:111
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
评论(0)