MySQL如何一行数据统计多个COUNT
SELECT
count(CASE WHEN 字段 = ‘值’ THEN 1 end) as ‘A’,
count(CASE WHEN 字段 = ‘值’ THEN 1 end) ‘B’,
count(CASE WHEN 字段 = ‘值’ THEN 1 end) ‘C’
FROM table
WHERE 条件
————————————————
版权声明:本文为CSDN博主「LeeShaoQing」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_43040108/article/details/118575601