<?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 single * and up to 1 rows in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687368#M302411</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;Select single fetches only a single record based on the where conditon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select...upto 1 rows selects all the records satisfying the where condition but displays only one record&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Nov 2006 14:10:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-01T14:10:12Z</dc:date>
    <item>
      <title>select single * and up to 1 rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687365#M302408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the exact difference between select single *...and select up to 1 rows?&lt;/P&gt;&lt;P&gt;and which is faster in exicution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Nov 2006 13:30:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687365#M302408</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-01T13:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: select single * and up to 1 rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687366#M302409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://www.sap-basis-abap.com/abap/difference-between-select-single-and-up-to-1-row.htm" target="test_blank"&gt;http://www.sap-basis-abap.com/abap/difference-between-select-single-and-up-to-1-row.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Nov 2006 13:32:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687366#M302409</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-11-01T13:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: select single * and up to 1 rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687367#M302410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chk this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex code&lt;/P&gt;&lt;P&gt;***********&lt;/P&gt;&lt;P&gt;Report Z_Difference &lt;/P&gt;&lt;P&gt;Message-id 38 &lt;/P&gt;&lt;P&gt;Line-Size 80 &lt;/P&gt;&lt;P&gt;Line-Count 0 &lt;/P&gt;&lt;P&gt;No Standard Page Heading. &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Start-Of-Selection. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Data: w_Single type Posnr, &lt;/P&gt;&lt;P&gt;t_Rows type standard table of Posnr &lt;/P&gt;&lt;P&gt;initial size 0 &lt;/P&gt;&lt;P&gt;with header line. &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Select single Posnr &lt;/P&gt;&lt;P&gt;from zDifference &lt;/P&gt;&lt;P&gt;into w_Single. &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Select Posnr &lt;/P&gt;&lt;P&gt;into table t_Rows &lt;/P&gt;&lt;P&gt;from zDifference &lt;/P&gt;&lt;P&gt;up to 1 rows &lt;/P&gt;&lt;P&gt;order by Posnr descending. &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; 'Select single:', w_Single. &lt;/P&gt;&lt;P&gt;Skip 1. &lt;/P&gt;&lt;P&gt;Write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; 'Up to 1 rows :'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at t_Rows. &lt;/P&gt;&lt;P&gt;Write t_Rows. &lt;/P&gt;&lt;P&gt;EndLoop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not &lt;/P&gt;&lt;P&gt;using all the primary key fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single is a construct designed to read database records with primary key. In the absence of the primary key, &lt;/P&gt;&lt;P&gt;it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key &lt;/P&gt;&lt;P&gt;supplied and will try to find most suitable index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way to find out is through sql trace or runtime analysis. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) &lt;/P&gt;&lt;P&gt;you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the &lt;/P&gt;&lt;P&gt;second or the third record has the value you are looking for. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional &lt;/P&gt;&lt;P&gt;level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS. &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;If this results in multiple records then only the first one will be returned and therefore may not be unique. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mainly: to read data from &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 &lt;/P&gt;&lt;P&gt;are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns &lt;/P&gt;&lt;P&gt;the first record of the result set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mainly: to check if entries exist. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can refer to the below link..&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/difference-between-select-single-and-select-upto-one-rows.htm" target="test_blank"&gt;http://www.sap-img.com/abap/difference-between-select-single-and-select-upto-one-rows.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;anver&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if hlped pls mark points&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Nov 2006 13:35:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687367#M302410</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-11-01T13:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: select single * and up to 1 rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687368#M302411</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;Select single fetches only a single record based on the where conditon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select...upto 1 rows selects all the records satisfying the where condition but displays only one record&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Nov 2006 14:10:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687368#M302411</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-01T14:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: select single * and up to 1 rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687369#M302412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select single is used for primary key fields&lt;/P&gt;&lt;P&gt;select up to 1 rows is used for non key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; and select single st. stops the search after finding corresponding value. but select up to 1 rows does the search for the entire table even after matching the criteira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Nov 2006 14:18:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687369#M302412</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-01T14:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: select single * and up to 1 rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687370#M302413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check&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="1788182"&gt;&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>Wed, 01 Nov 2006 14:22:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687370#M302413</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-01T14:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: select single * and up to 1 rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687371#M302414</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; Select single is faster.&lt;/P&gt;&lt;P&gt; With select up to i rows ...database hit high compare &lt;/P&gt;&lt;P&gt; to select single.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Performance point of view select single is the best.&lt;/P&gt;&lt;P&gt; Go to SE30--&amp;gt; Runtime analysis .....see tips &amp;amp; Tracks.&lt;/P&gt;&lt;P&gt; Thnaks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;padmaja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Nov 2006 14:53:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687371#M302414</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-01T14:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: select single * and up to 1 rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687372#M302415</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;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Nov 2006 15:15:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-up-to-1-rows/m-p/1687372#M302415</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-01T15:15:03Z</dc:date>
    </item>
  </channel>
</rss>

