단순 기록용으로 답안 남깁니다. 문제: 카드 지출액 + 월별 요금 - 특정 금액 이상 지출한 월의 요금 select sum(amount) - 5*(12-min(counted_month)) from transactions origin cross join ( select count(*) as counted_month from (select date_trunc('month', date) as ym from transactions where amount 2 and sum(amount)