select
if(month(dte)<11, year(dte), year(dte)+1) as `ปีงบประมาณ`,
sum(amt)
from (
select '2017-12-01' as dte, 100 as amt union
select '2017-11-01', 100 union
select '2017-10-31', 100 union
select '2016-12-01', 300 union
select '2016-11-01', 300 union
select '2016-10-31', 300
) as tmp
group by if(month(dte)<11, year(dte), year(dte)+1)