久久福利_99r_国产日韩在线视频_直接看av的网站_中文欧美日韩_久久一

您的位置:首頁技術文章
文章詳情頁

oracle update多表關聯

瀏覽:2日期:2023-11-20 13:07:02
UPDATE A.A3 = A.A3+B.B3 的問題表A 結構 : A1 , A2 ,A3 表B 結構: B1,; B2,; B3其中 A1 ,B1 為PK ,切值相同 就是可以使用A1 = B1 了.請問用SQL 語句或過程該如何實現如下的功能???更新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開執行計劃, 談論效率是沒有太多的意義的^_^..三樓的寫法與7樓的寫法得到的結果是不同的.三樓的寫法會更新所有記錄, 而7樓的寫法只修改兩者相交的相關記錄信息.7樓的寫法可以更加輕易的控制這條update語句的執行計劃, 不過要求B表必須在對應的字段上有主鍵索引:) , 在B表在對應字段上有主鍵索引的時候, 建議使用7樓的寫法.可以參考一下這個帖子^_^http://www.cnoug.org/viewthread.php?tid=44070(測試沒有成功..不知道怎么搞的.)參考了下面的:非常佩服。抱著學習的態度,重寫了一下三樓的,在沒有主鍵的情況,請指教: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)
標簽: Oracle 數據庫
主站蜘蛛池模板: 欧美一区二区三区在线 | 亚洲一区二区在线电影 | 亚洲 欧美 自拍偷拍 | 欧美成人免费在线观看 | 亚洲欧美综合精品久久成人 | 伊人伊人 | 精品国产一区二区三区不卡蜜臂 | 视频一区 中文字幕 | 亚洲影视一区二区 | 国产精品三级久久久久久电影 | 日韩成人精品 | 亚洲视频在线观看免费 | 国产一区二区在线视频 | 99精品久久久 | 激情毛片 | 成人做爰69片免费 | 国产精品黄视频 | 91精品久久久久久久久久入口 | 色婷婷av久久久久久久 | 综合网av | 干干干操操操 | 综合激情久久 | 国产成人片 | 久久精品播放 | 国产最新精品视频 | 成人国产精品久久 | 国产亚洲一区二区三区 | 欧美精品一区二区三区蜜桃视频 | 国产精品久久久久国产a级 国产精品欧美一区二区三区不卡 | 成人久久18免费观看 | 成人在线视频免费观看 | 国产成人一区二区三区影院在线 | 国产 欧美 日韩 一区 | 99视频精品 | 男女羞羞视频网站18 | 欧美成人一区二区 | 四虎影院最新网址 | 在线观看国精产品二区1819 | 国产精品久久一区 | 国产一区二区亚洲 | ririsao久久精品一区 |