Answer the question
In order to leave comments, you need to log in
How to fill in missing records in a MySQL selection grouped by day/hour?
There is a table, statistics on user transitions are written to it.
It has a timestamp field.
I make a selection by the number of records for a certain hour / day and group by this hour / day, but if there was no transition at a certain hour / day, then accordingly this record will not fall into the selection and will not be displayed on the chart.
How to fill in these missing entries so that everything is consistent?
Answer the question
In order to leave comments, you need to log in
The easiest way is to prepare a TEMPORARY table with a timestamp and substitute the values with your table via LEFT JOIN.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question