group by 查询分组后 组的条数

比如select gid from table group by gid

查询时使用下面的方法查询条数

select count(distinct gid) from table

使用select count(gid) from table group by gid是错误的

这样查询的是分组后 每个组内部的条数

posted @ 2015-06-09 10:52  荣超  阅读(1471)  评论(0编辑  收藏  举报