楼主没有给出表1和表2的关系阿,也就是说你要的A和D怎么该以怎样的组合形式插入的表3中 我现在就取出max组合 insert into 表3 (a,b) select max(a) a, max(b) b from ( select rownum No, A, null D from 表1 union all select rownum No, null A, D from 表2 ) group by No
insert into 表3(a,d) select A,D from (select distinct A from 表1) T1 ,(select distinct D from 表2) T2 ;
我现在就取出max组合
insert into 表3 (a,b)
select max(a) a, max(b) b
from (
select rownum No, A, null D from 表1
union all
select rownum No, null A, D from 表2
)
group by No
select A,D
from (select distinct A from 表1) T1
,(select distinct D from 表2) T2
;