I have a table:
ITEM_EXPENSES having columns:
ITEM | SUPPLIER | SEQ_NO | COUNTRY
100 A10 1 UAE
100 A10 2 SAU
I have another table with the same structure ITEM_EXPENSES_DELTA
ITEM | SUPPLIER | SEQ_NO | VALUE
100 A10 1 USA
100 A10 2 THA
I want to insert ITEM_EXPENSES_DELTA into ITEM_EXPENSES but the unique key is on ITEM, SUPPLIER, SEQ_NO
I want to data to be like:
ITEM | SUPPLIER | SEQ_NO | VALUE
100 A10 1 UAE
100 A10 2 SAU
100 A10 3 USA
100 A10 4 THA
The seq_no should be the next number on what is already in ITEM_EXPENSES
what should be the insert