Home > database >  The Oracle stored procedure two insert table compares cycle
The Oracle stored procedure two insert table compares cycle

Time:10-08

A sample table A:
Code name
001 A
001 A
002 B
003 C
003 C

The sample table B:
Code name
001 A
001 A
002 B

Want to use a cursor loop after contrast will B no data in the table to insert




CodePudding user response:

You don't need to use the cursor, only need a SQL can solve,
Insert into the select * from b, where a code not in (select encoding from b);

CodePudding user response:

Insert into the select * from b minus the select * from b

CodePudding user response:

Just want to learn how to implement with the cursor
  • Related