【发布时间】:2019-11-25 07:41:20
【问题描述】:
我想在两个日期之间循环,但我的 PL/pgSQL 代码进入了无限循环。我想我在这里遗漏了一些东西。
do $$
declare
the_dates date;
begin
select gs from generate_series('2019-11-01'::date, '2012-11-30', '1 day') as gs into the_dates;
loop
raise notice '%', the_dates;
end loop;
end
$$
我应该如何在这两个日期之间循环?
【问题讨论】:
标签: postgresql stored-procedures plpgsql postgresql-11