drop table tbl_b
create table tbl_a(
id number
)
insert into tbl_a(id)
values(1)
insert into tbl_a(id)
values(2)
insert into tbl_a(id)
values(3)
create table tbl_b(
id number
)
insert into tbl_b(id)
values(1)
insert into tbl_b(id)
values(4)
insert into tbl_b(id)
values(5)
--将a中存在而b中不存在的元素存入到b中
insert into tbl_b value (select id from tbl_a minus select id from tbl_b)
drop table tbl_c
create table tbl_c
as(select id from(select id from tbl_a minus select id from tbl_b)t where 1=1)
select id
from tbl_b