码迷,mamicode.com
首页 > 数据库 > 详细

oracle不支持update from的语法

时间:2020-03-06 10:26:00      阅读:88      评论:0      收藏:0      [点我收藏+]

标签:blog   http   logs   语法   length   upd   update   一个   支持   

更新一个表中的数据,但条件需要和另外的表进行连接;sql server可以使用update from语法,可参考下面的链接:

https://www.cnblogs.com/cnmarkao/p/3687398.html

昨天因更新,数据库是oracle的,发现oracle不支持update from的语法

昨晚根据需要改写了下:

update tabA
set (col1,col2,col3,col4,col5)=(select b.col1,b.col2,substr(b.col3,4,2),substr(b.col3,7,2),substr(b.col3,10,2) from tabB b where tabA.col6=b.col6)
where tabA.col6 in (select b.col6 from tabB b where length(b.col3)=11)

 

正不正确不重要,重要的是知道oracle不支持update from的语法,其他可以搜索~~

oracle不支持update from的语法

标签:blog   http   logs   语法   length   upd   update   一个   支持   

原文地址:https://www.cnblogs.com/cnmarkao/p/12425119.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!