更新一个表中的数据,但条件需要和另外的表进行连接;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