Select yearmonth, sum(case when Paymentoradjustment = \'Payment\' then Amount else 0 end) as Payment, sum(case when Paymentoradjustment = \'Adjustment\' then Amount else