i have a Table A having 100 ID,
Table B is having 20 ID
my requirement is Table C which should not have 20 ID from Table B
how to acheive this?
Hi Sanju,
Do you want to omit these 20 IDs from Table B even if they are present in Table A?
Keerthika
Yes
TableA:
// stuff for table A
TableB:
// stuff for table B
MapTableB:
MAPPING LOAD ID, false() as Flag RESIDENT TableB;
TableC:
LOAD * FROM TableC-Source (options)
WHERE ApplyMap('MapTableB', ID, true());
Best,
Peter
[Edit] Corrected. You want to end-up with 3 tables.
Can u please provide sample data..so it will be easy to solve your problem.
You can use where exist function for same
Plz eloborate this as u mentioned that table A having 100 ID's and Table B having 20 ID's ,where in Table C u want to show 100 ID's of A and to exclude Table B means u can use Residant load for Table c.
hi,
If you have table C from separate/different source you can use below script :
TableA:
// stuff for table A
TableB:
// stuff for table B
TableC:
LOAD * FROM TableC-Source (options)
WHERE NOT EXITS(ID);
or
If you have table C from table A you can use below script :
TableA:
// stuff for table A
TableB:
// stuff for table B
NoConcatenate
TableC:
LOAD * RESIDENT TableA
WHERE NOT EXITS(ID);
I hope this will help you
Regards
Ahmar
THE 20 ids FROM TABLE B ARE TO BE REMOVED FROM TABLE A
THE 20 ids FROM TABLE B ARE TO BE REMOVED FROM TABLE A
Please consider my replay in that second scenario will help you in that we will exclude ID which are already present in Table B