下载吧 - 绿色安全的游戏和软件下载中心

软件下载吧

当前位置:软件下载吧 > 技术开发 > 数据库 > postgresql 如何实现replace into功能的代码

postgresql 如何实现replace into功能的代码

时间:2024-02-07 12:09作者:下载吧人气:23

PostgreSQL 9.5-

使用函数或with实现

create table test(id int primary key, info text, crt_time timestamp);
with upsert as (update test set info=’test’,crt_time=now() where id=1 returning *) insert into test select 1,’test’,now() where not exists (select 1 from upsert where id=1);

标签MySQL,技术文档,数据库,PostgreSQL

相关下载

查看所有评论+

网友评论

网友
您的评论需要经过审核才能显示

热门阅览

最新排行

公众号