<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Intersection in Select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/intersection-in-select-statement/m-p/7244307#M1526776</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think a subquery may work here. Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT form TAB2 where not in TAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Oct 2010 15:02:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-10-05T15:02:38Z</dc:date>
    <item>
      <title>Intersection in Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/intersection-in-select-statement/m-p/7244304#M1526773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do any one know about some intersection option in select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My case is : I have 2 database tables say TAB1 and TAB2 . TAB1 has data (A, B, C, D) and TAB2 has data (B, D) now I want the output as (A and C) after joining these 2 tables and selecting. &lt;/P&gt;&lt;P&gt;That is I want the values of Table1 which are not there in Table2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the option of selecting Table1 and then for all entries fetch Table2, then Loop at the Table &amp;amp; delete if record exists.&lt;/P&gt;&lt;P&gt;But this is creating performance issue as the number of records in both tables are in Lakhs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I wanted to know is there any option like Left Intersecion or some thing like left outer join and all, so that I can pick the dat in one select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sameer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 14:31:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/intersection-in-select-statement/m-p/7244304#M1526773</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-05T14:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection in Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/intersection-in-select-statement/m-p/7244305#M1526774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LEFT OUTER JOIN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look it up in the ABAP help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 14:33:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/intersection-in-select-statement/m-p/7244305#M1526774</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-05T14:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection in Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/intersection-in-select-statement/m-p/7244306#M1526775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should be able to do this with a LEFT JOIN of these two tables (check F1 help). However if I remember correctly you cannot use fields of tab2 in the WHERE-condition, as in WHERE TAB2~FIELD1 IS NULL, to not even select those lines where tab2 has no matching entry.&lt;/P&gt;&lt;P&gt;You can delete these rows in a second step from the result table though.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. please use international units only, lakh = 100,000&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 14:36:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/intersection-in-select-statement/m-p/7244306#M1526775</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2010-10-05T14:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection in Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/intersection-in-select-statement/m-p/7244307#M1526776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think a subquery may work here. Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT form TAB2 where not in TAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 15:02:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/intersection-in-select-statement/m-p/7244307#M1526776</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-05T15:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection in Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/intersection-in-select-statement/m-p/7244308#M1526777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Issue solved : &lt;/P&gt;&lt;P&gt;Sample Code&lt;/P&gt;&lt;P&gt;TYPES : BEGIN OF X_VBAK,&lt;/P&gt;&lt;P&gt;        VBELN TYPE VBAK-VBELN,&lt;/P&gt;&lt;P&gt;        AUBEL TYPE VBRP-AUBEL.&lt;/P&gt;&lt;P&gt;TYPES : END OF X_VBAK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : I_VBAK TYPE STANDARD TABLE OF X_VBAK.&lt;/P&gt;&lt;P&gt;DATA : I_VBAS TYPE STANDARD TABLE OF X_VBAK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT  A&lt;SUB&gt;VBELN B&lt;/SUB&gt;AUBEL INTO CORRESPONDING FIELDS OF TABLE I_VBAK FROM ( VBAK AS A&lt;/P&gt;&lt;P&gt;  LEFT OUTER JOIN VBRP AS B ON A&lt;SUB&gt;VBELN EQ B&lt;/SUB&gt;AUBEL ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT I_VBAK BY VBELN.&lt;/P&gt;&lt;P&gt;delete ADJACENT DUPLICATES FROM i_vbak COMPARING ALL FIELDS.&lt;/P&gt;&lt;P&gt;DELETE I_VBAK WHERE AUBEL NE ''.&lt;/P&gt;&lt;P&gt;SORT I_VBAK BY VBELN.&lt;/P&gt;&lt;P&gt;SORT I_VBAS BY VBELN.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 06:37:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/intersection-in-select-statement/m-p/7244308#M1526777</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-19T06:37:07Z</dc:date>
    </item>
  </channel>
</rss>

