postgresql – Postgres函数将查询结果分配给多个变量
发布时间:2020-12-13 16:20:26 所属栏目:百科 来源:网络整理
导读:我需要在Postgres函数中为2变量赋值,如下所示. a := select col1 from tbl where ...b := select col2 from tbl where ... 如何在一个行命令中为2个变量分配2个值? 喜欢 a,b := select col1,col2 from tbl where ... 如 “40.5.3. Executing a Query with a
我需要在Postgres函数中为2变量赋值,如下所示.
a := select col1 from tbl where ... b := select col2 from tbl where ... 如何在一个行命令中为2个变量分配2个值? 喜欢 a,b := select col1,col2 from tbl where ...
如
“40.5.3. Executing a Query with a Single-row Result”所述(强调我的):
所以这应该工作: SELECT col1,col2 INTO a,b FROM tbl WHERE...; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |