I would like to get the list of dates from two fields: start and end. I found a case here: Show a list of dates between two dates?
But I would like to have a better solution without going through an intermediary table.
Here is the initial table:
Here is the result I would like to have:
Thank you
select t.id, t.name, t.g.dt::date as start_end
from the_table t
cross join generate_series(t.date_start, t.date_end, interval '1 day') as g(dt)
order by t.id, g.dt;