怎么向中间表里插入数据 中间表中就2个idAID ,BID ,然后我想向这张表里插入数据因为里面有数据了, AID BID1 22 3如果原来里面就有两条数据而我插入第三条数据的时候,这两条数据也要一起传过来,应该怎么插入第三条数据 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 --a为中间表,b为传入数据的表merge into tab1 ausing tab2 bon (a.aid=b.aid and a.bid=b.bid)when not matched then insert values (b.aid,b.bid); merge into tab1 ausing tab2 bon (a.aid=b.aid and a.bid=b.bid)when not matched then insert values (b.aid,b.bid); oracle 中可以这么写吗? ORACLE中经典的MERGER用法,,自己百度看看 merge into tab1 ausing tab2 bon (a.aid=b.aid and a.bid=b.bid)when not matched then insert values (b.aid,b.bid); merge ....但我确实是没看明白楼主啥意思? 明确点说, 原来数据库中有的数据,我在执行插入的时候,直接过滤掉 就比如说 表里已有的数据AID BID 1 22 3而传回来的数据有AID BID1 22 33 4我只要把 AID 3 BID 4这条插入进去,前两条过滤不插入,这只是一个例子,传回来的值不可能就一条,很可能是多条 oracle使用job,如何设置what参数调用过程? 实现细粒度数据访问 求解:SQL*Loader-522: lfiopn failed for file (ldr_case2.log) oralce 如何留后门? 高手帮忙下,怎么分段查询 关于ORACLE输出到EXCEL oracle无法连接到其他数据库(求救) oracle存储过程 中 与 的写法是? 对于同一程序,在一个数据库软件里建多个数据库的原因? 请问在Oracle下如何生成数据库字段的说明? 我写了一个2个表连接(inner join)的查询,怎么报错呢? Oracle 一个简单的插入语句问题
--a为中间表,b为传入数据的表
merge into tab1 a
using tab2 b
on (a.aid=b.aid and a.bid=b.bid)
when not matched then
insert values (b.aid,b.bid);
using tab2 b
on (a.aid=b.aid and a.bid=b.bid)
when not matched then
insert values (b.aid,b.bid);
oracle 中可以这么写吗?
ORACLE中经典的MERGER用法,,自己百度看看
merge into tab1 a
using tab2 b
on (a.aid=b.aid and a.bid=b.bid)
when not matched then
insert values (b.aid,b.bid);
但我确实是没看明白楼主啥意思?
明确点说, 原来数据库中有的数据,我在执行插入的时候,直接过滤掉 就比如说
表里已有的数据
AID BID
1 2
2 3
而传回来的数据有
AID BID
1 2
2 3
3 4
我只要把 AID 3 BID 4这条插入进去,前两条过滤不插入,这只是一个例子,传回来的值不可能就一条,很可能是多条