ITPub博客

首页 > 数据库 > Oracle > 给一个朋友看的一个题,题不难

给一个朋友看的一个题,题不难

原创 Oracle 作者:Angelina7 时间:2016-10-30 16:33:47 0 删除 编辑



(1)
merge into t1
using t2
on (t1.no + 199 = t2.no)
when matched then
    update set t1.区县 = t2.区县;

(2)
update /*+ leading(t2) use_hash(t1) */ t1
   set 区县 =
       (select 区县 from t2 where t1.no + 199 = t2.no);
(3)
至少有一个表的连接列是主键
update (select t1.no, t1.区县 t1a, t2.区县 t2a
          from t1
         inner join t2
            on (t1.tno + 199 = t2.no))
   set t1a = t2a;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31402276/viewspace-2127333/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 每日一练(四)
请登录后发表评论 登录
全部评论

注册时间:2016-10-14

  • 博文量
    31
  • 访问量
    12513