Skip to Content

Does Sybase / SAP ASE have the same issue like HANA with SELECTs without explicit ORDER BY

Jan 11 at 08:01 AM


avatar image

SAP HANA has the effect that ABAP SELECT without ORDER BY specified can return unexpected results (Code Inspector variant FUNCTIONAL_DB).

Does Sybase ASE have the same issue or how does it behave?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

ERALPER YILMAZ Jan 12 at 11:37 AM

Hello Michael,

Any query on any database does not guarantee that resultset will be returned according to a rule unless ORDER BY is used explicitly

For disk based databases, data is written in "data pages" which are linked somehow one another. If ORDER BY is not used in the query, SQL Engine will not spend CPU or processing power or time for sorting the data. It will return data from data pages, it could fetch in the fastest time. And because of fragmentation, etc data can be distributed or written to data pages randomly.

SQL Server, Oracle and as you noted Sybase does not guarentee the sorting without ORDER BY

10 |10000 characters needed characters left characters exceeded