Group by month in SQLite
it is always good while you group by MONTH it should check YEAR also
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);
Try the following:
SELECT SUM(price), strftime('%m', transDate) as monthFROM your_tableGROUP BY strftime('%m', transDate);
Use the corresponding page in SQLite documentation for future references.