関数ではなく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
エラー エラー: "varchar" またはその近くで構文エラーが発生しました LINE 2: c varchar; ^ どなたか助けていただければ幸いです