是oracle 用 PL SQLtable1 yl1 yl3
table2 dwdm
如果 table1的yl3 和table2 的 dwdm 相同, 则把table2 的 dwdm 更新为table1 的yl1update table2 set b.dwdm = a.YL1 from table2 b,table1 a where b.dwdm=a.yl3执行提示ORA-00933: SQL 命令未正确结束 不知道哪错了
在线等 谢谢
table2 dwdm
如果 table1的yl3 和table2 的 dwdm 相同, 则把table2 的 dwdm 更新为table1 的yl1update table2 set b.dwdm = a.YL1 from table2 b,table1 a where b.dwdm=a.yl3执行提示ORA-00933: SQL 命令未正确结束 不知道哪错了
在线等 谢谢
2、更严密的写法
update table2 b set b.dwdm=(select a.yl1 from table1 a where b.dwdm=a.yl3) where exists (select yl3 from table1 a where b.dwdm=a.yl3);
3、楼主的结帖率太低了。
(select table1.yl1 from table1 where table1.yl3=table2.dwdm), table2.dwdm);