Postgres函数将查询结果分配给多个变量


28

我需要在Postgres函数中将值赋给2变量,如下所示。

a := select col1 from tbl where ...
b := select col2 from tbl where ...

如何在一行命令中将2个值分配给2个变量?

喜欢

a,b := select col1,col2 from tbl where ...

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.