distinct 单个字段 解决方案
select 要使用字段1,要使用字段2 from 表名 where id in (select min(id) from 表名 group by 不重复字段名)
例:
select byid,id from bbs where id in (select min(id) from bbs group by byid)
select * from table where id in (select min(id) from table group by a,b,c)
select * from table where id in (select min(id) from table group by a,b,c)
引用
https://www.cnblogs.com/q149072205/p/4318133.html
如有错误,请邮件zs253499660@sina.com,如有更好的方法,可以推荐