I would like to create a temporary table in MySQL which would return 365 rows, each for all 365 days which preceded today.
In SQL Server I would do this:
with
dates as (SELECT dateadd(day,-365,cast(getdate() as date)) as daten union all select dateadd(day,+1,daten) from dates where daten<dateadd(day,-1,getdate()))
select * from dates
option(maxrecursion 0)
Is there a way to obtain something similar in MySQL?
Thank you.