小编Xia*_*lin的帖子

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

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

a := select col1 from tbl where ...
b := select col2 from tbl where ...
Run Code Online (Sandbox Code Playgroud)

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

喜欢

a,b := select col1,col2 from tbl where ...
Run Code Online (Sandbox Code Playgroud)

postgresql plpgsql functions

36
推荐指数
1
解决办法
7万
查看次数

标签 统计

functions ×1

plpgsql ×1

postgresql ×1