SELECT
id,
count(IF(STATUS = 0, TRUE, NULL)) going,
count (IF(STATUS = 1, TRUE, NULL)) complete,
count (IF(STATUS = 2, TRUE, NULL)) cancel
FROM
table_1
GROUP BY
id
SELECT
id,
count(IF(STATUS = 0, TRUE, NULL)) going,
count (IF(STATUS = 1, TRUE, NULL)) complete,
count (IF(STATUS = 2, TRUE, NULL)) cancel
FROM
table_1
GROUP BY
id