开发者社区> 问答> 正文

mysql语句的修改

Mysql语句:update tb1 a,tb2 b set a.coll=b.coll,a.col2=b.col2 where a.key=b.key
改成Oracle语句怎么改?

展开
收起
落地花开啦 2016-02-13 15:50:08 1854 0
1 条回答
写回答
取消 提交回答
  • 喜欢技术,喜欢努力的人

    这样应该可以
    `update tb1 a set a.col1=(select b.col1 from tb2 b where a.key=b.key and rownum=1),
    a.col2=(select b.col2 from tb2 b where a.key=b.key and rownum=1)
    where exists (select 1 from tb2 b where a.key=b.key)`

    2019-07-17 18:42:06
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
搭建电商项目架构连接MySQL 立即下载
搭建4层电商项目架构,实战连接MySQL 立即下载
PolarDB MySQL引擎重磅功能及产品能力盛大发布 立即下载

相关镜像