mysql可以同时修改两张表,pgsql只能修改一张
mysql写法:
update table1 a,table2 b
set a.colA=a.colA+1
where a.id = b.id;
pgsql写法:
update table1 t set t.colA=t.colA+1
本文比较了MySQL和PostgreSQL在同时更新两张表时的不同方法,MySQL允许使用简单的`SET`语句,而PostgreSQL则需要使用`INNERJOIN`进行操作。
mysql可以同时修改两张表,pgsql只能修改一张
mysql写法:
update table1 a,table2 b
set a.colA=a.colA+1
where a.id = b.id;
pgsql写法:
update table1 t set t.colA=t.colA+1
9973
4722
3800
679

被折叠的 条评论
为什么被折叠?