<?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 INNER JOIN vs WHERE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-vs-where/m-p/8276460#M1633397</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i really would wonder if this select you coded worked at all or is compilable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In join ONLY conditions that are neccessary to join the tables make sense. rest should be done in the where clause.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Oct 2011 11:53:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-10-06T11:53:57Z</dc:date>
    <item>
      <title>SELECT INNER JOIN vs WHERE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-vs-where/m-p/8276459#M1633396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the best programming, putting selection in the inner join or in where clause.  Below is some sample code that works but wondering if C~statu='X' would have been better in the Where part of the statement in stead as part of the inner join?  Maybe don't need the Where in this select statment just code in the inner joins?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT a&lt;SUB&gt;lgnum a&lt;/SUB&gt;bdatu b&lt;SUB&gt;tanum b&lt;/SUB&gt;tapos a&lt;SUB&gt;tbnum b&lt;/SUB&gt;tbpos b~werks&lt;/P&gt;&lt;P&gt;         b&lt;SUB&gt;lgort b&lt;/SUB&gt;matnr b&lt;SUB&gt;meins b&lt;/SUB&gt;maktx b&lt;SUB&gt;vsolm b&lt;/SUB&gt;vltyp b~vlpla&lt;/P&gt;&lt;P&gt;         b~nlpla&lt;/P&gt;&lt;P&gt;    INTO TABLE gt_ltak&lt;/P&gt;&lt;P&gt;    FROM ltak AS a&lt;/P&gt;&lt;P&gt;    INNER JOIN ltap AS b ON b&lt;SUB&gt;lgnum = a&lt;/SUB&gt;lgnum AND&lt;/P&gt;&lt;P&gt;                                             b&lt;SUB&gt;tanum = a&lt;/SUB&gt;tanum&lt;/P&gt;&lt;P&gt;    INNER JOIN lrf_wkqu AS c ON c&lt;SUB&gt;lgnum = a&lt;/SUB&gt;lgnum     AND&lt;/P&gt;&lt;P&gt;                                                     c~bname = sy-uname AND&lt;/P&gt;&lt;P&gt;                                                     c&lt;SUB&gt;queue = a&lt;/SUB&gt;queue    AND&lt;/P&gt;&lt;P&gt;                                                     c~statu = 'X'&lt;/P&gt;&lt;P&gt;    INNER JOIN zis_prog_vars AS d ON d~pgm = 'ZRF_TRANS_03_0100' AND&lt;/P&gt;&lt;P&gt;                                                              d~fld = l_priority                            AND&lt;/P&gt;&lt;P&gt;                                                              d&lt;SUB&gt;val1 = a&lt;/SUB&gt;tbpri&lt;/P&gt;&lt;P&gt;    WHERE a~lgnum = '170'        AND&lt;/P&gt;&lt;P&gt;                 a~tanum = '0000001399'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 11:49:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-vs-where/m-p/8276459#M1633396</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-06T11:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INNER JOIN vs WHERE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-vs-where/m-p/8276460#M1633397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i really would wonder if this select you coded worked at all or is compilable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In join ONLY conditions that are neccessary to join the tables make sense. rest should be done in the where clause.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 11:53:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-vs-where/m-p/8276460#M1633397</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-06T11:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INNER JOIN vs WHERE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-vs-where/m-p/8276461#M1633398</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;Herewith the corrected version:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT a~lgnum a~bdatu b~tanum b~tapos a~tbnum b~tbpos b~werks
       b~lgort b~matnr b~meins b~maktx b~vsolm b~vltyp b~vlpla b~nlpla

  INTO TABLE gt_ltak
  FROM ltak AS a

 INNER JOIN ltap AS b ON b~lgnum = a~lgnum AND
                         b~tanum = a~tanum   

 INNER JOIN lrf_wkqu AS c ON c~lgnum = a~lgnum AND
                             c~queue = a~queue AND

 INNER JOIN zis_prog_vars AS d ON d~val1 = a~tbpri

 WHERE a~lgnum = '170'
   AND a~tanum = '0000001399'
   AND c~bname = sy-uname
   AND c~statu = 'X' 
   AND d~pgm = 'ZRF_TRANS_03_0100'
   AND d~fld = l_priority.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kr,&lt;/P&gt;&lt;P&gt;m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 15:23:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-vs-where/m-p/8276461#M1633398</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-06T15:23:48Z</dc:date>
    </item>
  </channel>
</rss>

