日期:2014-05-17  浏览次数:20895 次

新手求解 ORA-00933: SQL 命令未正确结束
是oracle 用 PL SQL

table1 yl1 yl3  
table2 dwdm
如果 table1的yl3 和table2 的 dwdm 相同, 则把table2 的 dwdm 更新为table1 的yl1

update table2 set b.dwdm = a.YL1 from table2 b,table1 a where b.dwdm=a.yl3

执行提示ORA-00933: SQL 命令未正确结束 不知道哪错了  
在线等 谢谢

------解决方案--------------------
SQL code
1、用分号结束
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、楼主的结帖率太低了。