MySQL、SQLServer、Oracle的update left join语法
mysql
UPDATE A LEFT JOIN B ON A.B_ID = B.B_ID SET A.A_NAME = B.B_NAME;
sqlserver
update A set A_NAME = B.B_NAME from A left join B ON A.B_ID = B.B_ID
sqlserver注意 前面两个A没有别称
oracle
UPDATE ( SELECT a.cont AS acont FROM A t LEFT JOIN B a ON t.id = a.id WHERE a.cont = '2452452' ) p SET p.cont = '2';
欢迎点评,共同学习,共同进步