V
Vinod
Hi All,
I've two tables, tempMaster table contains 100 records (duplicate of master
table) and child table contains part of hundred records. I would like to
delete all reccords in tempMaster table which are not matching with child
table .
E.g:
tempMaster table
Theater Country Product_ID column1 Column2 Column3
APAC INDIA xyz test1 test2 test3
APAC INDIA xyz1 test1 test2 test3
APAC China xyz2 test1 test2 test3
JAPAN Japan xyz3 test1 test2 test3
JAPAN Japan xyz4 test1 test2 test3
JAPAN Japan xyz5 test1 test2 test3
child table
Theater Country Product_ID
APAC INDIA xyz
APAC China xyz2
JAPAN Japan xyz5
Note: Product_ID is unique.
tempMaster table (Theater, Country and Product_ID) is copy of master table
with same no.of records.
My requirement is I need to delete the records in tempMaster table which are
not part of child table.
i.e., we can delete non-matching Product_IDs in tempMaster table by
comparing with child table Product_IDs.
After deleting records I should see Product_IDs in tempMaster table are
xyz,xyz2 and xyz5 only.
Please share your thoughts and ideas in deleting non-matching records as
mentioned above which will be appreciated.
Advanced Thanks
~Vins
I've two tables, tempMaster table contains 100 records (duplicate of master
table) and child table contains part of hundred records. I would like to
delete all reccords in tempMaster table which are not matching with child
table .
E.g:
tempMaster table
Theater Country Product_ID column1 Column2 Column3
APAC INDIA xyz test1 test2 test3
APAC INDIA xyz1 test1 test2 test3
APAC China xyz2 test1 test2 test3
JAPAN Japan xyz3 test1 test2 test3
JAPAN Japan xyz4 test1 test2 test3
JAPAN Japan xyz5 test1 test2 test3
child table
Theater Country Product_ID
APAC INDIA xyz
APAC China xyz2
JAPAN Japan xyz5
Note: Product_ID is unique.
tempMaster table (Theater, Country and Product_ID) is copy of master table
with same no.of records.
My requirement is I need to delete the records in tempMaster table which are
not part of child table.
i.e., we can delete non-matching Product_IDs in tempMaster table by
comparing with child table Product_IDs.
After deleting records I should see Product_IDs in tempMaster table are
xyz,xyz2 and xyz5 only.
Please share your thoughts and ideas in deleting non-matching records as
mentioned above which will be appreciated.
Advanced Thanks
~Vins