您的位置:首页 > 博客中心 > 数据库 >

oracle不支持update from的语法

时间:2022-03-15 18:26

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

昨天因更新,数据库是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的语法,其他可以搜索~~

本类排行

今日推荐

热门手游