当你按月分组时,它总是很好,它也应该检查YEAR
select SUM(transaction) as Price, DATE_FORMAT(transDate, "%m-%Y") as 'month-year' from transaction group by DATE_FORMAT(transDate, "%m-%Y");
FOR SQLITE
select SUM(transaction) as Price, strftime("%m-%Y", transDate) as 'month-year' from transaction group by strftime("%m-%Y", transDate);