Hi All,
Oracle 11.2
create table xxc_parent_tmp
as
select '222_P' parent_inv from dual
union all
select '333_P' parent_inv from dual
I want to delete credit memo rows from xxc_credit_tmp where the parent_inv is not null and if not exists in xxc_parent_tmp table.
and except where the parent invoices are NULL in xxc_credit_tmp .
Example: 111_CM Credit_inv has 2 parent_inv records 111_P parent_inv is not exists in xxc_parent_tmp table.
So i want to delete row where the parent_inv is '111_P' since it is not exists in xxc_parent_tmp table.
and so on....
create table xxc_credit_tmp
as
select '111_CM' Credit_inv, '111_P' parent_inv from dual
union all
select '111_CM' Credit_inv, '222_P' parent_inv from dual
union all
select '222_CM' Credit_inv, '333_P' parent_inv from dual
union all
select '333_CM' Credit_inv, '444_P' parent_inv from dual
union all
select '444_CM' Credit_inv, NULL parent_inv from dual