SELECT COUNT(1) AS 总数,
COUNT(CASE WHEN 条件 THEN 1 ELSE NULL END) AS 别名1,
COUNT(CASE WHEN 条件 THEN 1 ELSE NULL END) AS 别名2
FROM 表名
一条sql返回不同业务的数量统计
最新推荐文章于 2023-07-12 10:38:32 发布
SELECT COUNT(1) AS 总数,
COUNT(CASE WHEN 条件 THEN 1 ELSE NULL END) AS 别名1,
COUNT(CASE WHEN 条件 THEN 1 ELSE NULL END) AS 别名2
FROM 表名