<?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 Diff b/w inner join &amp; for all entries in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-inner-join-for-all-entries/m-p/3604512#M868160</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;How to extract data from multiple tables?&lt;/P&gt;&lt;P&gt;What is the difference between inner join and for all entries?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 23 Mar 2008 11:35:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-23T11:35:22Z</dc:date>
    <item>
      <title>Diff b/w inner join &amp; for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-inner-join-for-all-entries/m-p/3604512#M868160</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;How to extract data from multiple tables?&lt;/P&gt;&lt;P&gt;What is the difference between inner join and for all entries?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Mar 2008 11:35:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-inner-join-for-all-entries/m-p/3604512#M868160</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-23T11:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Diff b/w inner join &amp; for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-inner-join-for-all-entries/m-p/3604513#M868161</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:&lt;/P&gt;&lt;P&gt;inner join used for combin two table.&lt;/P&gt;&lt;P&gt;support u can fetch two table. u can write select query two time .data base fetch time take twotime read from db.&lt;/P&gt;&lt;P&gt;so using primary key we easy write inner join. but both table primary key and both field refer same field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inner Join and Outer Join &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data that can be selected with a view depends primarily on whether the view implements an inner join or an outer join. With an inner join, you only get the records of the cross-product for which there is an entry in all tables used in the view. With an outer join, records are also selected for which there is no entry in some of the tables used in the view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The set of hits determined by an inner join can therefore be a subset of the hits determined with an outer join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Database views implement an inner join. The database therefore only provides those records for which there is an entry in all the tables used in the view. Help views and maintenance views, however, implement an outer join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES works with a database in a quantity-oriented manner. Initially all data is collected in an internal table. Make sure that this table contains at least one entry (query sy-subrc or DESCRIBE), otherwise the subsequent transaction will be carried out without any restrictions).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT...FOR ALL ENTRIES IN is treated like a SELECT statement with an external OR condition. The system only selects those table entries that meet the logical condition .&lt;/P&gt;&lt;P&gt;Using FOR ALL ENTRIES is recommended when data is not being read from the database, that is, it is already available in the program, for example, if the user has input the data. Otherwise a join is recommended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample code for inner join with for all entries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT s&lt;SUB&gt;posnr s&lt;/SUB&gt;lfimg s&lt;SUB&gt;mbdat f&lt;/SUB&gt;budat&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE i_delivery&lt;/P&gt;&lt;P&gt;FROM lips as s&lt;/P&gt;&lt;P&gt;INNER JOIN mkpf as f ON s&lt;SUB&gt;vbeln = f&lt;/SUB&gt;LE_VBELN&lt;/P&gt;&lt;P&gt;for all entries in itab " &amp;lt;&amp;lt; change&lt;/P&gt;&lt;P&gt;WHERE s~vbeln in s_vbeln&lt;/P&gt;&lt;P&gt;AND s~mbdat in s_mbdat&lt;/P&gt;&lt;P&gt;AND f~budat in s_budat&lt;/P&gt;&lt;P&gt;AND s~erdat in s_erdat2&lt;/P&gt;&lt;P&gt;AND S~posnr = itab-posnr. "&amp;lt;&amp;lt; change&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Mar 2008 11:45:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-inner-join-for-all-entries/m-p/3604513#M868161</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-23T11:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Diff b/w inner join &amp; for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-inner-join-for-all-entries/m-p/3604514#M868162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;U can extract the data from multiple tables in 3 ways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Inner / outer joins&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. For All Entries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Logical Databases&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generally Innerjoins are used in between the tables who have parent child relation ship.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can use for all entries in between two tables with having a single field in common. (Most Preferabble)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So use as per ur necessity and of the using innerjoin is an performance issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Mar 2008 12:19:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-inner-join-for-all-entries/m-p/3604514#M868162</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-23T12:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Diff b/w inner join &amp; for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-inner-join-for-all-entries/m-p/3604515#M868163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check out the below related threads&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="4915075"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5087342"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Mar 2008 12:38:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-inner-join-for-all-entries/m-p/3604515#M868163</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-23T12:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Diff b/w inner join &amp; for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-inner-join-for-all-entries/m-p/3604516#M868164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajnikanth,&lt;/P&gt;&lt;P&gt;Extraction of data from multiple tables can be done in 2 ways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Joins(Inner/Outer)&lt;/P&gt;&lt;P&gt;2. FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Joins.&lt;/P&gt;&lt;P&gt;Joins are used to get the data from multiple tables with single select query into one internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. For all entries will work like a select end select. But it will fetch the data in a single go. So it is much faster than Nested selects, select end select and Joins. But there are some mandatory checks has to be done for using FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.CHECK whether driver table is INITIAL or NOT.(Mandatory)&lt;/P&gt;&lt;P&gt;2.SORT the Driver table based on the fields to be specified in WHERE CLAUSE. (To Improve performance)&lt;/P&gt;&lt;P&gt;3.DELETE ADJACENT DUPLICATES FROM Driver table. (To Improve performance)&lt;/P&gt;&lt;P&gt;Draw backs: Although it&amp;#146;s very good to use this still there are few draw backs with this.&lt;/P&gt;&lt;P&gt;1.If we don&amp;#146;t check the Driver table is INITIAL or NOT and if it is INITIAL then the select will fetch all the entries in data base which is unexpected result.&lt;/P&gt;&lt;P&gt;2.Field type and length of Driver table and driven table must match in the WHERE clause. Otherwise program will through syntax error. Some times for this requirement we need to take some extra internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both have their own advantages and disadvantages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In joins u have all the data in single table but performance wise joins are slower compared to for all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifying join condition is difficult task. If some thing goes wrong here it will fetch unexpected records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For all entries limitations are already stated above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So use JOINS or for all entries based on ur requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also check below links.&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;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3330537"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Mar 2008 12:54:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-inner-join-for-all-entries/m-p/3604516#M868164</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2008-03-23T12:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Diff b/w inner join &amp; for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-inner-join-for-all-entries/m-p/3604517#M868165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;inner join &amp;amp; for all entries both are same. but the difference way of using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mainly we can use innerjoins we r fetching less data . suppose &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;take two tables spfli(carrid,connid)&lt;/P&gt;&lt;P&gt;                       sflight(carrid,connid,fldate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suppose u want fetch he information of flight kingfisher on which date it scheduled to travel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then u can go for innerjoins&lt;/P&gt;&lt;P&gt; select spfli~carrid&lt;/P&gt;&lt;P&gt;           spfli~connid&lt;/P&gt;&lt;P&gt;           fldate&lt;/P&gt;&lt;P&gt;    from spfli&lt;/P&gt;&lt;P&gt;    inner join sflight on&lt;/P&gt;&lt;P&gt;   spfli-carrid=sflightcarrid and&lt;/P&gt;&lt;P&gt;   spfli-connid=sflightconnid&lt;/P&gt;&lt;P&gt;where spfli-carrid = 'kf'&lt;/P&gt;&lt;P&gt;into table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suppose u want get all the flight details in which date they scheduled  u go for forallentries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; first fetch data from spfli into it_spfli&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select carrid&lt;/P&gt;&lt;P&gt;          connid&lt;/P&gt;&lt;P&gt;   from spfli&lt;/P&gt;&lt;P&gt;   into  table it_spfli&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select carrid&lt;/P&gt;&lt;P&gt;          connid&lt;/P&gt;&lt;P&gt;          fldate&lt;/P&gt;&lt;P&gt;   from sflight&lt;/P&gt;&lt;P&gt;  into   table it_sflight&lt;/P&gt;&lt;P&gt;  forr all entries in table it_spfli&lt;/P&gt;&lt;P&gt;where carrid = it_spfli-carrid&lt;/P&gt;&lt;P&gt;          connid = it_spfli-connid&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Mar 2008 13:12:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-b-w-inner-join-for-all-entries/m-p/3604517#M868165</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-23T13:12:11Z</dc:date>
    </item>
  </channel>
</rss>

