Skip to content Skip to sidebar Skip to footer

Sum Over Values By Month In Milliseconds

I have table with Values and Date. Values in Integer and date is Integer in milliseconds from 1970's... I need to get sum(value) for each month and i haven't any idea how to do it

Solution 1:

You have to convert the dates into a format supported by SQLite so that you can extract the month:

SELECT strftime('%Y-%m', date / 1000, 'unixepoch') AS month,
       SUM(value) AS sum
FROM entry
GROUP BY 1

Post a Comment for "Sum Over Values By Month In Milliseconds"