表a1 A B
00001 DAS
00002 SDF
00003 ASD
00004 KJHF
00005 JKLK
..... ...
表b1 A B ...............
00001 DGGGD .............
00001 GDGDG ...............
00001 CBCBCVB .............
00002 QEQEWQE ..........
00002 NVBNVBN .............
00002 QWDFSA ...............
00003 NVNVBNN .............
00003 VBCGFG ..........
00004 FSDF .............
00004 DASDA ...............
00005 FDSFS .............
00003 SDFFSD ..........
00003 SFFSD .............
00004 SDDSFD ...........
表c1 B C D ......
DGGGD .............
GDGDG ...............
DASDA ...............
FDSFS .............
更新的结果需要是:
表B A B
00001 DAS
00001 DAS
00001 DAS
00002 SDF
00002 SDF
00002 SDF
00003 ASD
00003 ASD
00004 KJHF
00004 KJHF
00005 JKLK
00003 ASD
00003 ASD
00004 KJHF
表c1 B C D ......
DAS .............
DAS ...............
KJHF ...............
JKLK .............
跪求更新b1和c1表的sql 语句。 请各位高手帮忙
1 个解决方案
#1
update c1 set b=(select a1.b from a1,b1 where a1.a=b1.a and b1.b=c1.b);
update /*+ parallel(b1,2) */ b1 set b=(select b from a1 where a1.a=b1.a);
供参考
update /*+ parallel(b1,2) */ b1 set b=(select b from a1 where a1.a=b1.a);
供参考
#1
update c1 set b=(select a1.b from a1,b1 where a1.a=b1.a and b1.b=c1.b);
update /*+ parallel(b1,2) */ b1 set b=(select b from a1 where a1.a=b1.a);
供参考
update /*+ parallel(b1,2) */ b1 set b=(select b from a1 where a1.a=b1.a);
供参考