我想在 postgres 中声明变量,但不在函数中...
Declare
c varchar;
a integer;
b integer;
select b = count (*) from table
set a = 1
while a <= b
begin
select c = [c] from table where id = a
if (c = '1')
insert into table2 select(*) from table
end
set a = a+1
但错误 ERROR:在“varchar” LINE 2 处或附近出现语法错误:c varchar;^ 我希望任何人都可以帮助我