Hi I would like to ask if it's possible to input dates starting from 01-01-2020 to 04-15-2020. Currently I have this code to iterate or to keep looping for each day from 00:00:00 to 23:00:00.
INSERT INTO dashboard.availability(terminal_id, availability_date, availability_time)
select td.terminal_id, td.down_date, (hh * interval '1 hour')::time
from (select distinct terminal_id, down_date
from dashboard.down_event
) td cross join
generate_series(0, 23) gs(hh);
But can i also do it the same for the date looping each day until the date reached 2020-04-15?
For example:
terminal_id availability_time availability_date
_____________ ___________________ _____________________
012345678 00:00:00 2020-01-01
012345678 01:00:00 2020-01-01
012345678 02:00:00 2020-01-01
012345678 03:00:00 2020-01-01
.
.
.
012345678 00:00:00 2020-04-15