Skip to content
Advertisement

Fill every minute in an interval of timestamps with a static record in a MySQL table

I have a time series in MySQL and need to write a cycle as described by the pseudocode below:

how do I write this, optimally, in MySQL?

Advertisement

Answer

You can use a recursive CTE:

Here is a db<>fiddle.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement