Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sanjujeeboy
Creator
Creator

exclude common records

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?

10 Replies
keerthika
Creator II
Creator II

Hi Sanju,

Do you want to omit these 20 IDs from Table B even if they are present in Table A?

Keerthika

sanjujeeboy
Creator
Creator
Author

Yes

Peter_Cammaert
Partner - Champion III
Partner - Champion III

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.

prasad_b
Partner - Contributor
Partner - Contributor

Can u please provide sample data..so it will be easy to solve your problem.

You can use where exist function for same

dathathreya
Creator
Creator

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.

ahmar811
Creator III
Creator III

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

sanjujeeboy
Creator
Creator
Author

THE 20 ids FROM TABLE B ARE TO BE REMOVED FROM TABLE A

sanjujeeboy
Creator
Creator
Author

THE 20 ids FROM TABLE B ARE TO BE REMOVED FROM TABLE A

ahmar811
Creator III
Creator III

Please consider my replay in that second scenario will help you in that we will exclude ID which are already present in Table B