我正在尝试将以下查询从Transact-SQL转换为PL / pgSQL
SELECT @val1 = val1, @val2= val2 FROM dbo.MyTable WHERE val3 = @val3
我已经出来了:
v_val1 := val1 FROM MyTable WHERE val3 = v_val3;
v_val2 := val2 FROM MyTable WHERE val3 = v_val3;
有更好的方法吗?可能与Transact-SQL
在同一个句子中答案 0 :(得分:3)
select val1, val2 into v_val1, v_val2
from mytable
where val3 = v_val3