l*g
2 楼
能不能用subquery?
t1 destination
t2 source
insert into t1
from
(
select rows on t2 but not on t1
)
t1 destination
t2 source
insert into t1
from
(
select rows on t2 but not on t1
)
l*g
4 楼
1. 两表结构并不完全相同
well, we have to assume everything you need for insert could be found from
f2, right? otherwise, you are missing data source anyway.
if that's true, then you can get from f2 section in the subquery, right?
2. 想用主键来判断
that's what you do in the subquery? 主键is primary key(s), right?
for quick example:
insert into t1
select fields from f2 from
(
t2 outer join t1 by key
minus
t2 equal join t1 by key
)
In short, you need to think about mathematics matirx before detailed
implementation with specific database.
【在 s****a 的大作中提到】
:
: 如果两表结构并不完全相同,而是想用主键来判断呢
well, we have to assume everything you need for insert could be found from
f2, right? otherwise, you are missing data source anyway.
if that's true, then you can get from f2 section in the subquery, right?
2. 想用主键来判断
that's what you do in the subquery? 主键is primary key(s), right?
for quick example:
insert into t1
select fields from f2 from
(
t2 outer join t1 by key
minus
t2 equal join t1 by key
)
In short, you need to think about mathematics matirx before detailed
implementation with specific database.
【在 s****a 的大作中提到】
:
: 如果两表结构并不完全相同,而是想用主键来判断呢
相关阅读
黑色星期五就要坐5小时飞机了真想把反光板撬了举报mitbbs国丧日照常娱乐 (转载)Fuji GF670和Voigtlander Bessa III是一样的东西么?新买的canon T1i LCD上划了一道划痕,请教!bh看望远镜归来Discover 信用卡送$75+$60 限时 Chase信用卡送350刀[FS] 百诺C-358M8三脚架带A24短中柱 $330是不是现在参加活动已经没包子了给5D2买了个wireless remote control进了个ipad是说gf1这样的革命机不需要view finder么?编程太多,脖子疼了,还有救吗 (转载)[参加活动]转瞬即逝的刹那---宝丽莱系列用iPhone 3GS为平面模特拍照的全过程(ZZ)300 一问请推荐黄橙色滤镜Leica R询价NikonD90相机请教nikon 3100泻的差不多了