- Create tables
1
2
3
4
5
6
7
create table CLIENT_TABLE_OLD(
CLIENTID number(19)
);
create table CLIENT_TABLE_NEW(
CLIENTID number(19) primary key
);
- insert data into tables
1
2
3
4
5
6
7
8
9
10
11
insert into CLIENT_TABLE_NEW (CLIENTID) values(1);
insert into CLIENT_TABLE_NEW (CLIENTID) values(2);
insert into CLIENT_TABLE_NEW (CLIENTID) values(3);
insert into CLIENT_TABLE_NEW (CLIENTID) values(4);
insert into CLIENT_TABLE_NEW (CLIENTID) values(5);
insert into CLIENT_TABLE_OLD (CLIENTID) values(4);
insert into CLIENT_TABLE_OLD (CLIENTID) values(5);
insert into CLIENT_TABLE_OLD (CLIENTID) values(6);
insert into CLIENT_TABLE_OLD (CLIENTID) values(7);
insert into CLIENT_TABLE_OLD (CLIENTID) values(8);
- Find all records that are missing from old table
1
2
3
4
5
6
7
8
select clientid from CLIENT_TABLE_NEW
minus
select clientid from CLIENT_TABLE_OLD;
CLIENTID
1
2
3
Cleanup
- Drop tables
1
2
drop table CLIENT_TABLE_OLD;
drop table CLIENT_TABLE_NEW;