<?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 without a key field in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032787#M1349641</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;any other thoughts please&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Aug 2009 16:29:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-20T16:29:36Z</dc:date>
    <item>
      <title>select without a key field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032784#M1349638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;experts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; we need to fetch only one record from the ztable and ztable has 6 key fields and 5 non key fields. one non key field is the active status indicator. At any time only one record will be active . I mean if i have same record 5 times but in that 5 records only one will be active.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my select query i am using  first 4 key fields and rest 2 fields creation data and time i am not using and i am using active indicator field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i am using select single statement.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do i need to write this in select upto 1 rows because I am not using all key fields or can&lt;/P&gt;&lt;P&gt;i still use select single because i am using active field in where clause. &lt;/P&gt;&lt;P&gt;please tell me which one is best and why?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 14:04:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032784#M1349638</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-20T14:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: select without a key field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032785#M1349639</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;If you use select single then you should provide all the key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if you are using select up to 1 row then you can give part of the key fields and it will fetch exact data what you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any way in current scenario both the satement will work because you have used active indicator fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because above mentioned things are just for performace. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarads,&lt;/P&gt;&lt;P&gt;Raj Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 14:17:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032785#M1349639</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-20T14:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: select without a key field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032786#M1349640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   at a time only 1 record is active then use select single only it's very useful at the run time and memeory usage. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause or lack of, applies any aggregate, ordering or grouping functions to them and then returns the first record of the resultant result set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Salil...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 14:20:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032786#M1349640</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-20T14:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: select without a key field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032787#M1349641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;any other thoughts please&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 16:29:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032787#M1349641</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-20T16:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: select without a key field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032788#M1349642</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;&lt;STRONG&gt;SELECT SINGLE&lt;/STRONG&gt; will be best i think too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Faisal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 16:39:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032788#M1349642</guid>
      <dc:creator>faisalatsap</dc:creator>
      <dc:date>2009-08-20T16:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: select without a key field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032789#M1349643</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;If you analyse deeply i think SELECT UPTO 1 ROWS is more efficient than SELECT SINGLE. Particularly when dealing with a table containing  large number of records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The basic difference between SELECT SINGLE and SELECT UPTO 1 ROWS is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) SELECT SINGLE will fetch all the records which satisfies the where conditions in to the memory and then supply only the first record of the selected records and this often misleads programmers that it selects only a single record directly. This can lead to performance degradation when accessing large number of tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) SELECT UPTO 1 ROWS will directly fetch only the first record which satisfies the where condition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus i would suggest you to use SELECT UPTO 1 ROWS particularly when dealing with tables containing millions of records. For smaller tables there wouldnt be much of a performance issue between the two&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: vikred on Aug 20, 2009 10:16 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 16:44:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032789#M1349643</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-20T16:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: select without a key field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032790#M1349644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hi,&lt;/P&gt;&lt;P&gt;&amp;gt;    at a time only 1 record is active then use select single only it's very useful at the run time and memeory usage. &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause .&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause or lack of, applies any aggregate, ordering or grouping functions to them and then returns the first record of the resultant result set. &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Salil...&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is incorrect. Exactly opposite of what happens. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this [&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5663383"&gt;&lt;/A&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>Thu, 20 Aug 2009 16:55:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032790#M1349644</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-20T16:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: select without a key field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032791#M1349645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;best method to test.&lt;/P&gt;&lt;P&gt;goto se30-&amp;gt;tips and tricks-&amp;gt;sql query&lt;/P&gt;&lt;P&gt;put both codes in two boxes. click measurement,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then check the runtime and use.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 19:48:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032791#M1349645</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-20T19:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: select without a key field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032792#M1349646</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;On using the select up to 1 rows or select single the opearation is going to be same. The thing that you need to keep in mind for consideration is the performance based on the where clause. Make sure of the volume of the data. If the volume is less then any approach is fair enough to the system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If in case the volume is large then create an index for the table so that the fectch is performed better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Swetha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2009 05:48:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-without-a-key-field/m-p/6032792#M1349646</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-21T05:48:31Z</dc:date>
    </item>
  </channel>
</rss>

