<?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: select or inner join in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-or-inner-join/m-p/3785846#M910835</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;  If you are using Inner join u need to join with all the possible keys...then its affeciant, else using for all entries is fine..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 May 2008 17:25:37 GMT</pubDate>
    <dc:creator>former_member156446</dc:creator>
    <dc:date>2008-05-05T17:25:37Z</dc:date>
    <item>
      <title>select or inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-or-inner-join/m-p/3785843#M910832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have to extract data from 3 different tables.&lt;/P&gt;&lt;P&gt;is a single inner join better option or separate select statements ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 17:13:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-or-inner-join/m-p/3785843#M910832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T17:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: select or inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-or-inner-join/m-p/3785844#M910833</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;Inner join used upon 3 tables is fine and the performance is also better. But dont use for more than 3 as the efficiency degrades.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the sample code for an inner join on 3 tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT stpo~stlnr stpo~idnrk mast~matnr mara~mtart stpo~menge  
INTO CORRESPONDING FIELDS OF TABLE zmat1 FROM mast  
JOIN stpo ON stpo~stlnr = mast~stlnr  
JOIN mara ON mara~matnr = mast~matnr  
WHERE stpo~stlty = 'M' "AND stpo~idnrk IN s_matnr  
AND mast~werks = 1000.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Pls reward if useful.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sirisha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 17:17:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-or-inner-join/m-p/3785844#M910833</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T17:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: select or inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-or-inner-join/m-p/3785845#M910834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi check this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for all entries is always better than the joins ..so kindly use the for all entries in the select statements..you can check the response time in the ST05 tcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 17:17:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-or-inner-join/m-p/3785845#M910834</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T17:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: select or inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-or-inner-join/m-p/3785846#M910835</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;  If you are using Inner join u need to join with all the possible keys...then its affeciant, else using for all entries is fine..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 17:25:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-or-inner-join/m-p/3785846#M910835</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2008-05-05T17:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: select or inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-or-inner-join/m-p/3785847#M910836</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;Better to go with the &lt;STRONG&gt;FOR ALL ENTRIES&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriram Ponna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 17:29:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-or-inner-join/m-p/3785847#M910836</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T17:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: select or inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-or-inner-join/m-p/3785848#M910837</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; If there are common key fields in the three tables, then inner join is a better option else its better to use for all entries to fetch the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want an example to join 3 tables, you can find it at this path in SAP&lt;/P&gt;&lt;P&gt;ABAPDOCU(Transaction)&lt;DEL&gt;&amp;gt;ABAP Database Access&lt;/DEL&gt;&amp;gt;Open SQL&lt;DEL&gt;&amp;gt;Read data&lt;/DEL&gt;&amp;gt;Inner Join.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;you can find the following code&lt;/STRONG&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF wa,&lt;/P&gt;&lt;P&gt;        carrid TYPE spfli-carrid,&lt;/P&gt;&lt;P&gt;        connid TYPE spfli-connid,&lt;/P&gt;&lt;P&gt;        fldate TYPE sflight-fldate,&lt;/P&gt;&lt;P&gt;        bookid TYPE sbook-bookid,&lt;/P&gt;&lt;P&gt;      END OF wa,&lt;/P&gt;&lt;P&gt;      itab LIKE SORTED TABLE OF wa&lt;/P&gt;&lt;P&gt;                WITH UNIQUE KEY carrid connid fldate bookid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT  p&lt;SUB&gt;carrid p&lt;/SUB&gt;connid f&lt;SUB&gt;fldate b&lt;/SUB&gt;bookid&lt;/P&gt;&lt;P&gt;  INTO  CORRESPONDING FIELDS OF TABLE itab&lt;/P&gt;&lt;P&gt;  FROM  ( ( spfli AS p&lt;/P&gt;&lt;P&gt;            INNER JOIN sflight AS f ON p&lt;SUB&gt;carrid = f&lt;/SUB&gt;carrid AND&lt;/P&gt;&lt;P&gt;                                       p&lt;SUB&gt;connid = f&lt;/SUB&gt;connid    )&lt;/P&gt;&lt;P&gt;            INNER JOIN sbook   AS b ON b&lt;SUB&gt;carrid = f&lt;/SUB&gt;carrid AND&lt;/P&gt;&lt;P&gt;                                       b&lt;SUB&gt;connid = f&lt;/SUB&gt;connid AND&lt;/P&gt;&lt;P&gt;                                       b&lt;SUB&gt;fldate = f&lt;/SUB&gt;fldate     )&lt;/P&gt;&lt;P&gt;  WHERE p~cityfrom = 'FRANKFURT' AND&lt;/P&gt;&lt;P&gt;        p~cityto   = 'NEW YORK'  AND&lt;/P&gt;&lt;P&gt;        f&lt;SUB&gt;seatsmax &amp;gt; f&lt;/SUB&gt;seatsocc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab INTO wa.&lt;/P&gt;&lt;P&gt;  AT NEW fldate.&lt;/P&gt;&lt;P&gt;    WRITE: / wa-carrid, wa-connid, wa-fldate.&lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;  WRITE / wa-bookid.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpfull&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Adithya M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 17:30:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-or-inner-join/m-p/3785848#M910837</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T17:30:46Z</dc:date>
    </item>
  </channel>
</rss>

