Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
listar dinamicamente fecha usando recursividad en mysql
with recursive
p as (
select cast(:fecha_desde as date) fecha_desde ,
cast(:fecha_hasta as date) fecha_hasta
),
fechas as (
select cast(p.fecha_desde as date) fecha
from p
union
select date_add(f.fecha, interval 1 day)
from fechas f, p
where fecha < p.fecha_hasta
)
select *
from fechas;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment