PostgreSQL增删改使用 returning 获取记录相关属性
PostgreSQL 大约 286 字returning
增删改时返回该记录的属性。
示例
returning *
插入时返回记录的所有字段
insert into test(test_filed1, test_filed2) values('123','abc') returning *;
returning id
更新时返回记录的id值
update test set test_filed1='456', test_filed2='xyz' where id = 10 returning id;
多条记录
insert
/update
/delete
多条记录时returning
也将返回多条记录的集合。
阅读 2096 · 发布于 2020-03-31
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看
换一批