<?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: Problem with SELECT UP TO 1 ROWS STATEMENT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605511#M1438022</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a table in a relational database no first nor last record exists. There is no sequence guaranteed except you specify an order by clause.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Feb 2010 12:00:00 GMT</pubDate>
    <dc:creator>rainer_hbenthal</dc:creator>
    <dc:date>2010-02-01T12:00:00Z</dc:date>
    <item>
      <title>Problem with SELECT UP TO 1 ROWS STATEMENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605505#M1438016</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;&lt;/P&gt;&lt;P&gt;I am facing a problem with the select query where in SELECT UP TO 1 ROWS is used.There are 2 records in the table abc which&lt;/P&gt;&lt;P&gt;are satisfting WHERE caluse conditions of query, but query is sometimes returning right record and some times wrong record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What could be the reason  behind this random behaviour of query?Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            SELECT vkorg&lt;/P&gt;&lt;P&gt;                   vtweg&lt;/P&gt;&lt;P&gt;                   spart&lt;/P&gt;&lt;P&gt;                   kschl&lt;/P&gt;&lt;P&gt;                   kunnr&lt;/P&gt;&lt;P&gt;                   matnr&lt;/P&gt;&lt;P&gt;                   datab&lt;/P&gt;&lt;P&gt;                   zgocoahnid&lt;/P&gt;&lt;P&gt;                   zzacseq&lt;/P&gt;&lt;P&gt;                   aufnr&lt;/P&gt;&lt;P&gt;              INTO TABLE t_abc&lt;/P&gt;&lt;P&gt;              FROM abc  UP TO 1 ROWS&lt;/P&gt;&lt;P&gt;              FOR ALL ENTRIES IN t_xyx&lt;/P&gt;&lt;P&gt;             WHERE vkorg EQ t_wa-vkorg&lt;/P&gt;&lt;P&gt;               AND vtweg EQ t_wa-vtweg&lt;/P&gt;&lt;P&gt;               AND spart EQ zt_wa-spart&lt;/P&gt;&lt;P&gt;               AND kschl EQ  t_xyz-kschl.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 07:42:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605505#M1438016</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-01T07:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SELECT UP TO 1 ROWS STATEMENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605506#M1438017</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;In Select UP TO 1 ROW statement sort or order by the select query to get the correct result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Khushboo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 07:45:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605506#M1438017</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-01T07:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SELECT UP TO 1 ROWS STATEMENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605507#M1438018</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 upto 1 record always gets one record ryt.. Moreover what is there in the table , it always get the first record only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 07:47:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605507#M1438018</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2010-02-01T07:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SELECT UP TO 1 ROWS STATEMENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605508#M1438019</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;Please go though the below thread....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_macro_name="thread" id="647844"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&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;Arbind&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 07:47:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605508#M1438019</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-01T07:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SELECT UP TO 1 ROWS STATEMENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605509#M1438020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also if you check this [WIKI|https://wiki.sdn.sap.com/wiki/display/ABAP/ABAP&lt;EM&gt;Performance&lt;/EM&gt;and+Tuning#ABAPPerformanceandTuning-WhatisthedifferencebetweenSELECTSINGLEandSELECT...UPTO1ROWS%3F]: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;SELECT SINGLE and SELECT UP TO n ROWS return the first matching row/rows for the given condition. It may not be unique, if there are more matching rows for the given condition.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the reason why your SELECT UP TO stmt is not returning the same record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Feb 1, 2010 1:50 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 08:19:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605509#M1438020</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-02-01T08:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SELECT UP TO 1 ROWS STATEMENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605510#M1438021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select up to 1 row will fetch all records satisfying the condition and keep it in a buffer.  From there, the first record is fetched.  It will try to find the most suitable index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using select single giving all the primary keys in the where condition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 09:40:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605510#M1438021</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-01T09:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SELECT UP TO 1 ROWS STATEMENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605511#M1438022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a table in a relational database no first nor last record exists. There is no sequence guaranteed except you specify an order by clause.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 12:00:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605511#M1438022</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2010-02-01T12:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SELECT UP TO 1 ROWS STATEMENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605512#M1438023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If the fields in the table are in primary key then write select single&lt;/P&gt;&lt;P&gt;or create Secondary index for the fields whic dont have primary key.&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;Azeez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 12:09:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605512#M1438023</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-01T12:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SELECT UP TO 1 ROWS STATEMENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605513#M1438024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;   it is better to u delete ADJACENT DUPLICATES FROM itab after select query..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Feb 2010 06:10:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-up-to-1-rows-statement/m-p/6605513#M1438024</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-02T06:10:13Z</dc:date>
    </item>
  </channel>
</rss>

