Postgresql 连接更新
发布时间:2020-12-13 16:11:01 所属栏目:百科 来源:网络整理
导读:update dbo.m_role_fun a set role_code = b.rsc from ( select rsc,fun_code from dbo.m_fun) b where a.fun_code = b.fun_code 几个开源数据库的连接更新的写法都不同,比较下来还是Postgres优雅点。 回顾下MySQL写法: update A join B on A.x = B.xset A
update dbo.m_role_fun a set role_code = b.rsc from (select rsc,fun_code from dbo.m_fun) b where a.fun_code = b.fun_code 几个开源数据库的连接更新的写法都不同,比较下来还是Postgres优雅点。 回顾下MySQL写法: update A join B on A.x = B.x set A.xx = B.xx Firebird 写法: MERGE INTO target [[AS] target-alias ] USING source [[AS] source-alias ] ON join-condition WHEN MATCHED THEN UPDATE SET colname = value [,colname = value ...] WHEN NOT MATCHED THEN INSERT [( <columns> )] VALUES ( <values> ) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |