Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Extract only the records exist in Table A but not in Table B

Former Member
0 Kudos

Hi guru, I need to compare two big SAP tables and only select the records that exist in Table A but not in Table B, i.e. Exclude the records that exist in both tables. Due to the volume, left outer join is not preferred. Does anybody know any smart and quick way to do so?

Thanks,

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Sounds like you're looking for alternatives from performance perspective, so maybe your question would be better posed in .

As always for any performance related questions the answer is: It depends...

I.e. you need to provide some further background: How many entries in table A, how many in table B? How are they linked (e.g. index, primary key, what fields)? On average, how many entries do you expect in your result set?

Depending on those parameters (and possibly others) one can then evaluate other options: There's probably not many, I'd try also using [subqueries|http://help.sap.com/abapdocu_70/en/ABENWHERE_LOGEXP_SUBQUERY.htm]. Since performance tuning always requires an analysis, it's best to try out the different variations and check what happens (e.g. how long do they run, what kind of load do they introduce on the database, etc.). Subquery versus outer join performance depends also on the used database.

Cheers, harald

1 REPLY 1

Former Member
0 Kudos

Sounds like you're looking for alternatives from performance perspective, so maybe your question would be better posed in .

As always for any performance related questions the answer is: It depends...

I.e. you need to provide some further background: How many entries in table A, how many in table B? How are they linked (e.g. index, primary key, what fields)? On average, how many entries do you expect in your result set?

Depending on those parameters (and possibly others) one can then evaluate other options: There's probably not many, I'd try also using [subqueries|http://help.sap.com/abapdocu_70/en/ABENWHERE_LOGEXP_SUBQUERY.htm]. Since performance tuning always requires an analysis, it's best to try out the different variations and check what happens (e.g. how long do they run, what kind of load do they introduce on the database, etc.). Subquery versus outer join performance depends also on the used database.

Cheers, harald