mysql分组统计以及全部统计union all使用
select '全部' AS `organ_category`, COUNT(*) AS amount FROM `organ_new` WHERE `city_code` ='SZ0755' AND `organ_type` ='P' AND `state` ='1' union all select `organ_category` ,COUNT(1) AS `amount` FROM `organ_new` WHERE `city_code` = 'SZ0755' AND `organ_type` ='P' AND `state` ='1' GROUP BY CONVERT(`organ_category` USING gbk) COLLATE gbk_chinese_ci,`organ_category` ASC
select '全部' AS `area`, COUNT(*) AS amount FROM `organ_new` WHERE `city_code` ='SZ0755' AND `organ_type` ='P' AND `state` ='1' union all select `area` ,COUNT(1) AS `amount` FROM `organ_new` WHERE `city_code` ='SZ0755' AND `organ_type` ='P' AND `state` ='1' GROUP BY CONVERT(`area` USING gbk) COLLATE gbk_chinese_ci,`area` ASC