<?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 statements in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768409#M906783</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. in the innerjoin system will hit the databasa one time.. then fetch the data..for the tables u have joined... when u use the join make sure the query shold not effect the performance.. try to paas all the primary key values.. then link the tables using the complete primary...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. when u use the FOR ALL ENTRIES.. the system will retrive all the records which matches the FIELDS which u r refering in the Internal tabel... while using the FOR ALL ENTRIES.. creal the duplicate entries.. other wise it select the record more number of time at data base level... but u will get the entries properly...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inner join can select all the common fields from the both table where as for all entries in can select all reocrds from first table then relavant fields from the second table.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table 1: records are 1 2 3 4 5 6 7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table 2: records are 1 2 5 6 7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then inner join selects : 1 2 5 6 7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where as for all entries in selects: 1 2 3 4 5 6 7 from table1&lt;/P&gt;&lt;P&gt;and 1 2 5 6 7 from table2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3 major drawbacks of the "for all entries" clause:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. duplicate rows are automatically removed&lt;/P&gt;&lt;P&gt;2. if the itab used in the clause is empty , all the rows in the source table will be selected .&lt;/P&gt;&lt;P&gt;3. performance degradation when using the clause on big tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go  through this link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/rob.burbank/blog/2007/03/19/joins-vs-for-all-entries--which-performs-better&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 May 2008 18:31:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-06T18:31:28Z</dc:date>
    <item>
      <title>select statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768405#M906779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;is it good to use innerjoin or any other select statement ?&lt;/P&gt;&lt;P&gt;and why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with regards&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;points will be rewarded if useful&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2008 18:15:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768405#M906779</guid>
      <dc:creator>Mohamed_Mukhtar</dc:creator>
      <dc:date>2008-05-06T18:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: select statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768406#M906780</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;It's desirable that you use &lt;STRONG&gt;FOR ALL ENTRIES&lt;/STRONG&gt; instead of inner join. When you use inner join, all data from the database table are recovered (not only the data that you will use - SELECT field1 field2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And it's easier to track the data using for all entries instead of inner join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest you to read this [https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6050] &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt;;. This blog have almost all information that you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2008 18:18:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768406#M906780</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-06T18:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: select statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768407#M906781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi depends on the situation we have to use ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select statetment with inner join &lt;/P&gt;&lt;P&gt;or select statement with for all entries..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the inner join is between 3 tables it is some what good but not more than 3 tables..for all entries is very best in using because the performance will increase more..you can test the performance with the tcode &lt;STRONG&gt;st05&lt;/STRONG&gt;  with these examples..&lt;/P&gt;&lt;P&gt;&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>Tue, 06 May 2008 18:19:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768407#M906781</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-06T18:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: select statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768408#M906782</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;"Using several nested INNER JOIN statements can be inefficient and cause time out if the tables become too big in the future."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joins here (in ABAP) are not those Native SQL Joins.  If you are talking about the Core RDBMS, which mean Oracle or SQL Server, then Undoubtedly Joins are the best.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In ABAP, these joins are first split by the ABAP processor and then sent to the database, with the increase in DATA in production system, these joins tend to give way if your database keeps growing larger and larger.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should rather used "FOR ALL ENTRIES IN" (Tabular conditions), which is a much efficient way as far as performance is concerned. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/several-nested-inner-join-statements-can-be-inefficient.htm" target="test_blank"&gt;http://www.sap-img.com/abap/several-nested-inner-join-statements-can-be-inefficient.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2008 18:28:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768408#M906782</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-06T18:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: select statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768409#M906783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. in the innerjoin system will hit the databasa one time.. then fetch the data..for the tables u have joined... when u use the join make sure the query shold not effect the performance.. try to paas all the primary key values.. then link the tables using the complete primary...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. when u use the FOR ALL ENTRIES.. the system will retrive all the records which matches the FIELDS which u r refering in the Internal tabel... while using the FOR ALL ENTRIES.. creal the duplicate entries.. other wise it select the record more number of time at data base level... but u will get the entries properly...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inner join can select all the common fields from the both table where as for all entries in can select all reocrds from first table then relavant fields from the second table.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table 1: records are 1 2 3 4 5 6 7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table 2: records are 1 2 5 6 7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then inner join selects : 1 2 5 6 7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where as for all entries in selects: 1 2 3 4 5 6 7 from table1&lt;/P&gt;&lt;P&gt;and 1 2 5 6 7 from table2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3 major drawbacks of the "for all entries" clause:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. duplicate rows are automatically removed&lt;/P&gt;&lt;P&gt;2. if the itab used in the clause is empty , all the rows in the source table will be selected .&lt;/P&gt;&lt;P&gt;3. performance degradation when using the clause on big tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go  through this link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/rob.burbank/blog/2007/03/19/joins-vs-for-all-entries--which-performs-better&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2008 18:31:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768409#M906783</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-06T18:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: select statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768410#M906784</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;Try acessing the transaction &lt;STRONG&gt;ST05&lt;/STRONG&gt;! It compares Inner Join with FOR ALL ENTRIES, and much more!&lt;/P&gt;&lt;P&gt;Remember: avoid SELECT statements inside LOOPs. For doing so, use FOR ALL ENTRIES IN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brian Gonsales&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2008 18:35:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768410#M906784</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-06T18:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: select statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768411#M906785</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;Our moto should be to hit the data base as less number of times as possible. &lt;/P&gt;&lt;P&gt;And usage of joins depends on the requirement. Instead of using FOR ALL entries we can use inner joins if the data is very less that has to be fetched.&lt;/P&gt;&lt;P&gt;Also, multiple joins is also not gud. because that will again increase the data base load and decrease the performance.&lt;/P&gt;&lt;P&gt;So, depending upon the records we have to use the select statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;imran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2008 18:44:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768411#M906785</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-06T18:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: select statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768412#M906786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2008 03:16:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statements/m-p/3768412#M906786</guid>
      <dc:creator>Mohamed_Mukhtar</dc:creator>
      <dc:date>2008-07-25T03:16:59Z</dc:date>
    </item>
  </channel>
</rss>

