我正在尝试将以下查询从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相同

最佳答案

select val1, val2 into v_val1, v_val2
from mytable
where val3 = v_val3

关于sql - 在PL/pgSQL中执行此查询的更好方法,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23095223/

10-12 06:01