SELECT
DATE_FORMAT(trans_date,'%Y-%m') AS month,
country,
COUNT(*) AS trans_count,
SUM(CASE WHEN state='approved' THEN 1 ELSE 0 END) AS approved_count,
SUM(amount) AS trans_total_amount,
SUM(CASE WHEN state='approved' THEN amount ELSE 0 END) AS approved_total_amount
FROM
Transactions
GROUP BY
month,
country
해당 문제의 국가는 null 이 존재함. 하지만 나라는 null이더라도 다른 것은 다 적혀있다.

그렇기 때문에 trans_count 를 전체로 잡아 줘야 됨.
COUNT(*) = NULL 값도 카운트함
COUNT(컬럼명) = NULL 값은 카운트 안함.