Answer the question
In order to leave comments, you need to log in
How to make a selection from the database by summing the field values by day?
The database has fields value (int) and created_at (date time in mills).
How to make a selection by date period with grouping by day and summing values per day?
Is it possible to extract the date from the field or do I need to add a field containing only the date without the time?
Or is it better to add a table in which to enter ready-made amounts / dates when adding / changing the data of the first table?
Answer the question
In order to leave comments, you need to log in
select
strftime('%d-%m-%Y', created_at) as creation_date,
sum(value) as val
from some_table
group by creation_date;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question