小编big*_*iff的帖子

错误:“coalesce”不是 INTO 子句中的已知变量

以下是我的示例函数

create or replace function samp(in a int) returns int as
$$
declare 
val int;
val1 int;
begin
select coalesce(a-1,1) into val,coalesce(a-2,1) into val1;
return val + val1;
end;
$$
language plpgsql 
Run Code Online (Sandbox Code Playgroud)

执行时出现以下错误

错误:“coalesce”不是已知变量第 7 行:选择 coalesce(a-1,1) into val,coalesce(a-2,1) into val1;

sql postgresql select select-into postgresql-9.2

2
推荐指数
1
解决办法
871
查看次数

标签 统计

postgresql ×1

postgresql-9.2 ×1

select ×1

select-into ×1

sql ×1