SELECT
COUNT(pkt) AS Pkt1,
COUNT(CASE WHEN Pkt = 0 THEN NULL ELSE Pkt END) AS Pkt2,
COUNT(CASE WHEN Pkt = 0 THEN 0 ELSE Pkt END) AS Pkt3,
COUNT(NULLIF(Pkt,0)) AS Pkt4
FROM (SELECT 0 AS Pkt UNION ALL SELECT 1 AS Pkt UNION ALL SELECT 0 AS Pkt UNION ALL SELECT 2 AS Pkt ) AS P
COUNT(pkt) AS Pkt1,
COUNT(CASE WHEN Pkt = 0 THEN NULL ELSE Pkt END) AS Pkt2,
COUNT(CASE WHEN Pkt = 0 THEN 0 ELSE Pkt END) AS Pkt3,
COUNT(NULLIF(Pkt,0)) AS Pkt4
FROM (SELECT 0 AS Pkt UNION ALL SELECT 1 AS Pkt UNION ALL SELECT 0 AS Pkt UNION ALL SELECT 2 AS Pkt ) AS P
0 Comments