问题
I want to insert a Date series into an existing table (public.test) in the column(day) starting from 2015-04-01 ,2015-04-02 ,.....to 2015-04-30.i know there is a generate series method in postgreSQL.But Can I generate dates using that or is there any other method to generate Dates?Any help is appreciated.
回答1:
smth like
insert into public.test ("day")
select generate_series('2015-04-01'::date,'2015-04-30'::date,'1 day'::interval);
should work
来源:https://stackoverflow.com/questions/41220822/how-to-insert-a-date-series-in-postgresql