SELECT
type,
count( * ) AS 激活数量,
sum( IF ( severity = 1, 1, 0 ) ) AS 1级数量,
sum( IF ( severity = 2, 1, 0 ) ) AS 2级数量,
sum( IF ( severity = 3, 1, 0 ) ) AS 3级数量,
sum( IF ( severity = 4, 1, 0 ) ) AS 4级数量
FROM
zt_bug
WHERE
product = ‘189‘
AND STATUS = ‘active‘
GROUP BY
type