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