在 postgresql 函数中,我试图将从表中选择的两个值转换为两个变量,但出现此错误:
INTO specified more than once at or near "INTO"
这是(伪)代码:
CREATE OR REPLACE FUNCTION func() RETURNS TRIGGER AS
$$
DECLARE
a numeric;
b varchar(20);
c numeric;
BEGIN
IF ... THEN
...
SELECT x INTO a FROM t1 WHERE y = 1
IF a > 5 THEN
SELECT m, n INTO b, c FROM t2 WHERE ...;
...
END IF;
END IF;
END
$$ LANGUAGE plpgsql;