<?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 statement- where! in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where/m-p/2828854#M661950</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Edgar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;remember one point when your writing where condition &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;don't use negative conditions in the where condition like NOT etc..&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;if you use negative operations then the performance problem will get &lt;BR /&gt;&lt;BR /&gt;so all way use positive conditions in the where condition &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;&lt;P&gt;Selection Criteria&lt;/P&gt;&lt;/B&gt;&lt;BR /&gt;Restrict the data to the selection criteria itself, rather than filtering it out using the ABAP code using CHECK statement.&amp;nbsp; &lt;BR /&gt;Select with selection list.&lt;BR /&gt;&lt;BR /&gt; Points # 1/2&lt;BR /&gt;&lt;BR /&gt;SELECT * FROM SBOOK INTO SBOOK_WA.&lt;BR /&gt; CHECK: SBOOK_WA-CARRID = 'LH' AND&lt;BR /&gt; SBOOK_WA-CONNID = '0400'.&lt;BR /&gt;ENDSELECT.&lt;BR /&gt;The above code can be much more optimized by the code written below which avoids CHECK, selects with selection list &lt;BR /&gt;&lt;BR /&gt;SELECT CARRID CONNID FLDATE BOOKID FROM SBOOK INTO TABLE T_SBOOK&lt;BR /&gt; WHERE SBOOK_WA-CARRID = 'LH' AND&lt;BR /&gt; SBOOK_WA-CONNID = '0400'.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;&lt;P&gt;reward if usefull&lt;/P&gt;&lt;/B&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 23 Sep 2007 06:12:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-23T06:12:00Z</dc:date>
    <item>
      <title>Select statement- where!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where/m-p/2828850#M661946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; In select statement, the where conditions could use 'IN select-range', while compare to IN (XX,FF,GG)/NOT IN((XX,FF,GG)), which is better on performance?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2007 17:22:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where/m-p/2828850#M661946</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-21T17:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement- where!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where/m-p/2828851#M661947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Better performance is IN  and if you use not in then you could get bad performance than in operator&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2007 17:26:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where/m-p/2828851#M661947</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-21T17:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement- where!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where/m-p/2828852#M661948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;NOT will cause the database to do a full table scan. Imagine if you want to find a word in the dictionary and all you know is that the word is not "shoe".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It'd take a while.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2007 18:04:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where/m-p/2828852#M661948</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-21T18:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement- where!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where/m-p/2828853#M661949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Always IN is much better than NOT IN. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2007 21:48:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where/m-p/2828853#M661949</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-21T21:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement- where!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where/m-p/2828854#M661950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Edgar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;remember one point when your writing where condition &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;don't use negative conditions in the where condition like NOT etc..&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;if you use negative operations then the performance problem will get &lt;BR /&gt;&lt;BR /&gt;so all way use positive conditions in the where condition &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;&lt;P&gt;Selection Criteria&lt;/P&gt;&lt;/B&gt;&lt;BR /&gt;Restrict the data to the selection criteria itself, rather than filtering it out using the ABAP code using CHECK statement.&amp;nbsp; &lt;BR /&gt;Select with selection list.&lt;BR /&gt;&lt;BR /&gt; Points # 1/2&lt;BR /&gt;&lt;BR /&gt;SELECT * FROM SBOOK INTO SBOOK_WA.&lt;BR /&gt; CHECK: SBOOK_WA-CARRID = 'LH' AND&lt;BR /&gt; SBOOK_WA-CONNID = '0400'.&lt;BR /&gt;ENDSELECT.&lt;BR /&gt;The above code can be much more optimized by the code written below which avoids CHECK, selects with selection list &lt;BR /&gt;&lt;BR /&gt;SELECT CARRID CONNID FLDATE BOOKID FROM SBOOK INTO TABLE T_SBOOK&lt;BR /&gt; WHERE SBOOK_WA-CARRID = 'LH' AND&lt;BR /&gt; SBOOK_WA-CONNID = '0400'.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;&lt;P&gt;reward if usefull&lt;/P&gt;&lt;/B&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Sep 2007 06:12:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where/m-p/2828854#M661950</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-23T06:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement- where!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where/m-p/2828855#M661951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;as far as optimization is concerned IN is better dan NOT IN ..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 11:23:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where/m-p/2828855#M661951</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T11:23:46Z</dc:date>
    </item>
  </channel>
</rss>

