select count(*) as count from(SELECT count(*) FROM 表名 WHERE 条件 GROUP BY id ) a;
select count(*) as total from (select count(*) from users group by user_id) u