色综合图-色综合图片-色综合图片二区150p-色综合图区-玖玖国产精品视频-玖玖香蕉视频

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

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

瀏覽:6日期:2023-11-20 13:07:02
UPDATE A.A3 = A.A3+B.B3 的問題表A 結(jié)構(gòu) : A1 , A2 ,A3 表B 結(jié)構(gòu): B1,; B2,; B3其中 A1 ,B1 為PK ,切值相同 就是可以使用A1 = B1 了.請問用SQL 語句或過程該如何實現(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開執(zhí)行計劃, 談?wù)撔适菦]有太多的意義的^_^..三樓的寫法與7樓的寫法得到的結(jié)果是不同的.三樓的寫法會更新所有記錄, 而7樓的寫法只修改兩者相交的相關(guān)記錄信息.7樓的寫法可以更加輕易的控制這條update語句的執(zhí)行計劃, 不過要求B表必須在對應(yīng)的字段上有主鍵索引:) , 在B表在對應(yīng)字段上有主鍵索引的時候, 建議使用7樓的寫法.可以參考一下這個帖子^_^http://www.cnoug.org/viewthread.php?tid=44070(測試沒有成功..不知道怎么搞的.)參考了下面的:非常佩服。抱著學(xué)習(xí)的態(tài)度,重寫了一下三樓的,在沒有主鍵的情況,請指教: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)
標(biāo)簽: Oracle 數(shù)據(jù)庫
主站蜘蛛池模板: 日本一区二区三区在线 视频观看免费 | 亚洲第四页 | 欧美日韩在线播放一区二区三区 | 亚洲色在线视频 | 狠狠色狠狠综合久久 | 99久久精品99999久久 | 国产一区二区三区亚洲综合 | 一级a爰片久久毛片 | 女人aaaaa片一级一毛片 | 深夜成人性视频免费看 | 国产综合精品在线 | 日本一区二区三区四区五区 | 国产精品理论 | 日韩精品视频一区二区三区 | 99久在线精品99re6视频 | 武松金莲肉体交战在线观看 | 日韩经典在线观看 | 国产精品视频男人的天堂 | 黄网在线观看免费网站台湾swag | 91成人国产网站在线观看 | www.99精品视频在线播放 | 男人天堂新地址 | 国产成人综合亚洲一区 | 女人张开双腿让男人桶完整 | 国产免费怡红院视频 | 日韩在线三级 | 高清一区二区在线观看 | www.成人网 | jiz欧美高清 | 波多野结衣在线观看高清免费资源 | 欧洲一级大片 | caoporen国产91在线 | 免费永久在线观看黄网 | 欧美一级毛片aaa片 欧美一级毛片不卡免费观看 | 亚洲一区二区三区91 | 亚洲一区2区三区4区5区 | 国产深夜福利视频网站在线观看 | tom影院亚洲国产 | 成人看的一级毛片 | 日韩欧美不卡一区二区三区 | 久热精品男人的天堂在线视频 |