<?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: data retrieval in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712562#M311643</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi the basic differece lies in b/w selct single &amp;amp; upto n rows is the consideration of primary key  .if we know  all  primary keys we have mention it in  in  select single  statement when we r using. in case of select upto n rows it is not the case .&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;supriya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Nov 2006 18:09:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-11T18:09:09Z</dc:date>
    <item>
      <title>data retrieval</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712557#M311638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SDNs,&lt;/P&gt;&lt;P&gt;     what is the difference between   select single... and  select upto one row...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;aravind.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Nov 2006 15:15:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712557#M311638</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-10T15:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: data retrieval</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712558#M311639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this link.&lt;/P&gt;&lt;P&gt;&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;Check SDN Wiki FAQ, third entry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap&lt;/A&gt;&lt;EM&gt;Performance&lt;/EM&gt;and+Tuning&amp;amp;&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Nov 2006 15:20:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712558#M311639</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-11-10T15:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: data retrieval</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712559#M311640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here we go :&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 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;&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, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Nov 2006 15:30:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712559#M311640</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-10T15:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: data retrieval</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712560#M311641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi aravind,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if we are giving all primary keys we will give select single.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if we do not have all primary keys and  we need only one record from the database, then we will give select upto one row (or you can give the number of rows).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Nov 2006 15:48:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712560#M311641</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-10T15:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: data retrieval</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712561#M311642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aravind,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use select single while you give all your primarys in the select and need not to give endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use upto one rows when there is possibility to get multiple records for the given condition and use endselect. this will get the first record which satisfies the given condtion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Anu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Nov 2006 15:57:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712561#M311642</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-10T15:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: data retrieval</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712562#M311643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi the basic differece lies in b/w selct single &amp;amp; upto n rows is the consideration of primary key  .if we know  all  primary keys we have mention it in  in  select single  statement when we r using. in case of select upto n rows it is not the case .&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;supriya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Nov 2006 18:09:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712562#M311643</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-11T18:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: data retrieval</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712563#M311644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks gurus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Mar 2011 04:44:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712563#M311644</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-05T04:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: data retrieval</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712564#M311645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select Single * will pickup only one matching record from the database into the buffer, and returns the same to the internal table.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Select upto 1 rows will pickup all the records matching the condition into the buffer, but return the top record to the internal table.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;For this reason, performance wise select upto 1 row is better than select upto 1 row.&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 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, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key 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) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the 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 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 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 are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Mar 2011 10:36:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-retrieval/m-p/1712564#M311645</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-05T10:36:33Z</dc:date>
    </item>
  </channel>
</rss>

