Skip to Content

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

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    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

    Add comment
    10|10000 characters needed characters exceeded