I have date column value as milliseconds in my sqlite table. Now - I need to group by month, year. For example, For 2020-Jan, sum = 1200, For 2020-Feb, sum = 1500 etc.
I checked couple of existing SO suggestions but strftime is not working for me. (May be because I have stored date as milliseconds instead of other standard format suggested by SQLITE doc.
I tried following code, but returns only one row for me.
select SUM(amount) as amount,
strftime("%m-%Y", date) as 'month-year'
from sys_item group by strftime("%m-%Y", date);
Can someone please help on this ?
Here is the sample data
I am expecting two columns result as follow:
2020-08 SUM1 2020-07 SUM2