Skip to content
Advertisement

How to duplicate rows generating dates between Start Date and End Date in BigQuery?

I’m having a question on how to duplicate rows in a table that generates dates between StartDate and EndDate. Actually, I have a same question as this Duplicating records to fill gap between dates in Google BigQuery but with a different type of table.

So, my table looks like this:

and I would like the output to be like this:

How should I put it in a query? Thanks in advance.

Advertisement

Answer

Below is for BigQuery Standard SQL

with result

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