select val1, val2 into v_val1, v_val2
from mytable
where val3 = v_val3
A better way to do this query in PL/pgSQL
-
04-07-2023 - |
سؤال
I am trying to turn the following query from Transact-SQL to PL/pgSQL
SELECT @val1 = val1, @val2= val2 FROM dbo.MyTable WHERE val3 = @val3
This with I have come out:
v_val1 := val1 FROM MyTable WHERE val3 = v_val3;
v_val2 := val2 FROM MyTable WHERE val3 = v_val3;
Is there a better way to do this? May be in the same sentence like Transact-SQL
المحلول
لا تنتمي إلى StackOverflow