av一区二区在线观看_亚洲男人的天堂网站_日韩亚洲视频_在线成人免费_欧美日韩精品免费观看视频_久草视

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

oracle update多表關(guān)聯(lián)

瀏覽:2日期:2023-11-20 13:07:02
UPDATE A.A3 = A.A3+B.B3 的問(wèn)題表A 結(jié)構(gòu) : A1 , A2 ,A3 表B 結(jié)構(gòu): B1,; B2,; B3其中 A1 ,B1 為PK ,切值相同 就是可以使用A1 = B1 了.請(qǐng)問(wèn)用SQL 語(yǔ)句或過(guò)程該如何實(shí)現(xiàn)如下的功能???更新A 表的 A3 ,用A.A3 與B.B3之和更新.3>update A set A3 = (select A.A3 + B.B3 from B where A.A1 = B.B1) ;7>update (select a1,a3,b1,b3 from a,b where a1=b1) set a3=a3+b3開(kāi)執(zhí)行計(jì)劃, 談?wù)撔适菦](méi)有太多的意義的^_^..三樓的寫法與7樓的寫法得到的結(jié)果是不同的.三樓的寫法會(huì)更新所有記錄, 而7樓的寫法只修改兩者相交的相關(guān)記錄信息.7樓的寫法可以更加輕易的控制這條update語(yǔ)句的執(zhí)行計(jì)劃, 不過(guò)要求B表必須在對(duì)應(yīng)的字段上有主鍵索引:) , 在B表在對(duì)應(yīng)字段上有主鍵索引的時(shí)候, 建議使用7樓的寫法.可以參考一下這個(gè)帖子^_^http://www.cnoug.org/viewthread.php?tid=44070(測(cè)試沒(méi)有成功..不知道怎么搞的.)參考了下面的:非常佩服。抱著學(xué)習(xí)的態(tài)度,重寫了一下三樓的,在沒(méi)有主鍵的情況,請(qǐng)指教:update aset a3=(select a3+b3 from b where a1=b1)where a1=(select b1 from b where a1=b1)如下:update con_eme_on20050309 a set a.con_price=(select a.con_price+(b.annuity-a.annuity)+(b.nojob-a.nojob)+(b.medicare-a.medicare)+(b.birthfee-a.birthfee)+(b.bruisefee-a.bruisefee) from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base),a.emp_base=(select b.emp_base from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base),a.annuity=(select b.annuity from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base),a.nojob=(select b.nojob from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base),a.medicare=(select b.medicare from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base),a.birthfee=(select b.birthfee from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base),a.bruisefee=(select b.bruisefee from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base),a.nojobbase=(select b.nojobbase from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base),a.mediabase=(select b.mediabase from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base),a.birthbase=(select b.birthbase from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base),a.bruisebase=(select b.bruisebase from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base)where a.emp_cod in(select b.emp_cod from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base)公積金:update con_eme_on20050309 a set a.con_price=(select a.con_price+(b.accumulation-a.accumulation) from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base),a.accumulation=(select b.accumulation from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base),a.accumulationbase=(select b.accumulationbase from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base),a.accumulationbase1=(select b.accumulationbase1 from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base) where a.emp_cod in(select b.emp_cod from con_eme_on200404 b where a.emp_cod=b.emp_cod and a.if_act='1' and a.emp_base!=b.emp_base)
主站蜘蛛池模板: 久久精品超碰 | 91超碰在线| 久久69精品久久久久久久电影好 | 亚洲电影专区 | 成人h动漫精品一区二区器材 | 综合在线视频 | 黄免费观看视频 | 欧美一区二区三区精品 | 又黄又爽的网站 | 日韩在线成人 | 欧美在线视频一区二区 | 一级做a| 精品久久久久久久久久 | 午夜在线免费观看 | 国产激情91久久精品导航 | 91看片网| 国产综合在线视频 | 精品国产乱码久久久 | 日本免费黄色一级片 | 亚洲国产网 | 久久国 | 亚洲欧洲视频 | 国产真实乱对白精彩久久小说 | 日韩在线视频免费观看 | 一区二区国产精品 | 亚洲综合大片69999 | 黑色丝袜三级在线播放 | 秋霞性生活| 精品国产一区二区三区观看不卡 | 一区二区三区四区免费观看 | 一区二区免费视频 | 国产第一亚洲 | 国产一区二区黑人欧美xxxx | 日韩欧美三级电影 | 国产女人精品视频 | 亚洲一区二区三区观看 | 永久www成人看片 | 国产黄色大片网站 | 91久久精品一区二区二区 | 欧美亚洲高清 | 欧美一区二区三区的 |