sql分组获取第一条或者最小一条值 很多人都在问这个问题,现在记录一下 select id from test as a where id = (select min(b.id ) from test as b where a.pid = b.pid);