实现方法:
SQL> create table a (
2 bm char(4),--编码
3 mc varchar2(20)--名称
4 )
5 /
表已建立.
SQL> insert into a values('1111','1111');
SQL> insert into a values('1112','1111');
SQL> insert into a values('1113','1111');
SQL> insert into a values('1114','1111');
SQL> insert into a values('1115','1111');
SQL> create table b as select * from a where 1=2;
表已建立.
SQL> insert into b values('1111','1111');
SQL> insert into b values('1112','1111');
SQL> insert into b values('1113','1111');
SQL> insert into b values('1114','1111');
SQL> commit;
完全提交.
SQL> select * from a;
BM MC
---- --------------------
1111 1111
1112 1111
1113 1111
1114 1111
1115 1111
SQL> select * from b;
BM MC
---- --------------------
1111 1111
1112 1111
1113 1111
1114 1111
SQL> select bm from a where not exists (select bm from b where a.bm=b.bm);
BM MC
---- --------------------
1115 1111