Mysql 分组之后如何统计记录条数并且去重复?
gourp by 之后的 count,把group by查询结果当成一个表再count一次:
select count(*) as count from
(SELECT count(*) FROM 表名 WHERE 条件 GROUP BY id ) a;
Mysql 分组之后如何统计记录条数并且去重复?
gourp by 之后的 count,把group by查询结果当成一个表再count一次:
select count(*) as count from
(SELECT count(*) FROM 表名 WHERE 条件 GROUP BY id ) a;