<?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 ABAP SELECT - JOIN condition vs. WHERE condition in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-join-condition-vs-where-condition/m-p/809129#M41641</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;this looks like basic ABAP question. I explored abapdocu. I see there are some clear differences (for example subqueries cannot be used in join_cond). But in other cases I am still a bit unsure what is preferred and why? &lt;/P&gt;
  &lt;P&gt;Is it just "semantic" what decides which cond do you use?&lt;/P&gt;
  &lt;P&gt;Here are examples of the SELECTs:&lt;BR /&gt;1) join_cond (ON)&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;SELECT mara~matnr INTO @l_material
  FROM mara
  INNER JOIN marc ON ( marc~matnr = mara~matnr AND
                       marc~werks = @p_werks ).&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;2) sql_cond (WHERE)&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;SELECT mara~matnr INTO @l_material
  FROM mara
  INNER JOIN marc ON ( marc~matnr = mara~matnr )
  WHERE marc~werks = @p_werks.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 22 Feb 2019 14:53:04 GMT</pubDate>
    <dc:creator>Tomas_Buryanek</dc:creator>
    <dc:date>2019-02-22T14:53:04Z</dc:date>
    <item>
      <title>ABAP SELECT - JOIN condition vs. WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-join-condition-vs-where-condition/m-p/809129#M41641</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;this looks like basic ABAP question. I explored abapdocu. I see there are some clear differences (for example subqueries cannot be used in join_cond). But in other cases I am still a bit unsure what is preferred and why? &lt;/P&gt;
  &lt;P&gt;Is it just "semantic" what decides which cond do you use?&lt;/P&gt;
  &lt;P&gt;Here are examples of the SELECTs:&lt;BR /&gt;1) join_cond (ON)&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;SELECT mara~matnr INTO @l_material
  FROM mara
  INNER JOIN marc ON ( marc~matnr = mara~matnr AND
                       marc~werks = @p_werks ).&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;2) sql_cond (WHERE)&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;SELECT mara~matnr INTO @l_material
  FROM mara
  INNER JOIN marc ON ( marc~matnr = mara~matnr )
  WHERE marc~werks = @p_werks.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Feb 2019 14:53:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-join-condition-vs-where-condition/m-p/809129#M41641</guid>
      <dc:creator>Tomas_Buryanek</dc:creator>
      <dc:date>2019-02-22T14:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP SELECT - JOIN condition vs. WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-join-condition-vs-where-condition/m-p/809130#M41642</link>
      <description>&lt;P&gt;Hi Tomas&lt;/P&gt;&lt;P&gt;I never used the first one if not with LEFT JOIN, but this for my own sake: I prefer to read the JOIN conditions in the ON... and the "filters" in WHERE.&lt;/P&gt;&lt;P&gt;About optimization, did you already try SAT and Trace to see if the behaviour changes?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 15:00:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-join-condition-vs-where-condition/m-p/809130#M41642</guid>
      <dc:creator>SimoneMilesi</dc:creator>
      <dc:date>2019-02-22T15:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP SELECT - JOIN condition vs. WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-join-condition-vs-where-condition/m-p/809131#M41643</link>
      <description>&lt;P&gt;With INNER JOIN, I guess there's no difference, but it's very different with OUTER JOIN. Is the question only for INNER JOIN ?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 15:05:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-join-condition-vs-where-condition/m-p/809131#M41643</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-02-22T15:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP SELECT - JOIN condition vs. WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-join-condition-vs-where-condition/m-p/809132#M41644</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; Only INNER, so it makes same result.&lt;/P&gt;&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;simone.milesi&lt;/SPAN&gt; I understand this opinion. Interesting that there is example (I know it is just example, not recommendation or so) in abapdocu on &lt;STRONG&gt;JOIN ... ON&lt;/STRONG&gt; where there is INNER JOIN example with join_cond used same like in my first example (parameter from selection screen)...&lt;BR /&gt;EDIT: did not tried SAT or trace. I will do...&lt;BR /&gt;EDIT2: ST05 trace is about the same. "Explain" for both selects is identical.&lt;BR /&gt;&lt;BR /&gt;Thank you both &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 15:12:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-join-condition-vs-where-condition/m-p/809132#M41644</guid>
      <dc:creator>Tomas_Buryanek</dc:creator>
      <dc:date>2019-02-22T15:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP SELECT - JOIN condition vs. WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-join-condition-vs-where-condition/m-p/809133#M41645</link>
      <description>&lt;P&gt;It depends how the database works in the end. I did an inner join on HANA and because I had some conditions in the join instead of the where, I used up all the memory.&lt;/P&gt;&lt;P&gt;There are general discussions concerning the best use of ON and WHERE across the web. it's not a SAP/ABAP specific issue.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 18:59:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-join-condition-vs-where-condition/m-p/809133#M41645</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2019-02-22T18:59:07Z</dc:date>
    </item>
  </channel>
</rss>

