<?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: How to avoid the below nested select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-the-below-nested-select-statement/m-p/6872076#M1477313</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;add POSITION_POSTDT  field into w_feeds. define an internal tab e.g.data: tmp_wfeeds like w_feeds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select field1 field2 position_postdt&lt;/P&gt;&lt;P&gt;into table w_feeds &lt;/P&gt;&lt;P&gt;from ZTable as t &lt;/P&gt;&lt;P&gt;where field2 in r_feedf1 &lt;/P&gt;&lt;P&gt;and POSITION_POSTDT  le r_pdate-high.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort w_feeds descending by POSITION_POSTDT .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table w_feeds index 1 into tmp_wfeeds.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Apr 2010 13:28:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-27T13:28:30Z</dc:date>
    <item>
      <title>How to avoid the below nested select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-the-below-nested-select-statement/m-p/6872075#M1477312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please any one help me how this select statemet is working and 	how to avoid the nesetd select statement .&lt;/P&gt;&lt;P&gt;if we avoid below nested , does it improve performace ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select field1 field2                                   &lt;/P&gt;&lt;P&gt;           into table w_feeds                                  &lt;/P&gt;&lt;P&gt;           from ZTable as t                          &lt;/P&gt;&lt;P&gt;           where field2 in r_feedf1                        &lt;/P&gt;&lt;P&gt;           and  POSITION_POSTDT =                            &lt;/P&gt;&lt;P&gt;           ( SELECT MAX( position_postdt ) FROM zTable  &lt;/P&gt;&lt;P&gt;                  where position_postdt le r_pdate-high     &lt;/P&gt;&lt;P&gt;                  and   field1 = t~field1 ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advace.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Apr 2010 13:07:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-the-below-nested-select-statement/m-p/6872075#M1477312</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-27T13:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid the below nested select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-the-below-nested-select-statement/m-p/6872076#M1477313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;add POSITION_POSTDT  field into w_feeds. define an internal tab e.g.data: tmp_wfeeds like w_feeds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select field1 field2 position_postdt&lt;/P&gt;&lt;P&gt;into table w_feeds &lt;/P&gt;&lt;P&gt;from ZTable as t &lt;/P&gt;&lt;P&gt;where field2 in r_feedf1 &lt;/P&gt;&lt;P&gt;and POSITION_POSTDT  le r_pdate-high.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort w_feeds descending by POSITION_POSTDT .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table w_feeds index 1 into tmp_wfeeds.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Apr 2010 13:28:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-the-below-nested-select-statement/m-p/6872076#M1477313</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-27T13:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid the below nested select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-the-below-nested-select-statement/m-p/6872077#M1477314</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;Instead of nested query go for two separate queries. I see you are querying on the same table...so better go by this approach&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select field1 field2 &lt;STRONG&gt;POSITION_POSTDT&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;into table w_feeds&lt;/P&gt;&lt;P&gt;from ZTable&lt;/P&gt;&lt;P&gt;where field2 in r_feedf1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remove the where condition on POSITION_POSTDT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort the table w_feeds by POSITION_POSTDT  Descending; So you will get data pertaining to Max Position_Postdt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally delete the other entries which are not Max.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will enhance the performance over the nested query.&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;Shiva&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Shiva Kumar Tirumalasetty on Apr 27, 2010 7:00 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Shiva Kumar Tirumalasetty on Apr 27, 2010 7:00 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Apr 2010 13:30:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-the-below-nested-select-statement/m-p/6872077#M1477314</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-27T13:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid the below nested select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-the-below-nested-select-statement/m-p/6872078#M1477315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 07:42:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-the-below-nested-select-statement/m-p/6872078#M1477315</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-28T07:42:13Z</dc:date>
    </item>
  </channel>
</rss>

