当前位置: 代码迷 >> Oracle管理 >> 生手求解 ORA-00933: SQL 命令未正确结束
  详细解决方案

生手求解 ORA-00933: SQL 命令未正确结束

热度:133   发布时间:2016-04-24 05:02:26.0
新手求解 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、楼主的结帖率太低了。