Skip to Content
-1
Former Member
Jun 21, 2017 at 10:26 AM

SELECT UP TO 1 ROWS.. ORDER BY PRIMARY KEY OR ORDER BY FIELDS

7826 Views

Hi Experts,

we are doing a ECC migration to HANA DB.

As part of custom code remediation process we used FUNCTIONAL_DB variant in ATC.

In few programs the existing code was written using SELECT SINGLE without passing full primary key.

We are replacing the select single statements with SELECT up to 1 rows but when I used select up to 1 rows, the results are not matching with the old system as we know the data in tables will be in sorted order in non-HANA system but in HANA because of column architecture the sort order will be different.

I want to know whether I have to use ORDER BY PRIMARY KEY or ORDER BY <FIELDS in SELECT List>

Thanks

Pawan Akella