oracle:
update emp a set a.deptno=( select c.deptno from dept c where c.dname='RESEARCH') where exists (select 1 from dept b where a.deptno=b.deptno and b.dname='SALES');
mysql:UPDATE emp a JOIN dept b ON a.deptno = b.deptno SET a.deptno = ( select c.deptno from dept c where c.dname='RESEARCH') WHERE b.dname='SALES';
UPDATE emp a ,dept b SET a.deptno = ( select c.deptno from dept c where c.dname='RESEARCH') WHERE a.deptno = b.deptno and b.dname='SALES';
oracle只支持相关子查询,不支持多表联连查询更新,仅记录一下。