Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Not Applicable

3 REPLIES 3

DominikTylczyn
Active Contributor

Hello cjojo

Unless you use ORDER BY, the result of a SELECT statement is not defined - see SAP Help SELECT:

If the addition ORDER BY is not used, the order of the rows in the results set is not defined and, if the same statement SELECT is executed multiple times, the order may be different each time.

So, what you see is not surprising.

You must not rely on the sequence of SELECT result if don't use ORDER BY or if you don't sort the result on the application side.

Best regards

Dominik Tylczynski

matt
Active Contributor

It seems that many people's IT education doesn't include that by definition relational databases do not have a default sort order.

matt
Active Contributor
0 Kudos

(Don't post QUESTIONS as ANSWERS, please! - read that bit next to the "Your answer" edit box, labelled "Before answering".

Randomly display. That's what Dominik means by Unless you use ORDER BY, the result of a SELECT statement is not defined and You must not rely on the sequence of SELECT result if don't use ORDER BY or if you don't sort the result on the application side.

This is something than many people seem to have missed in their IT education! With relational databases (i.e. every database used with SAP) there is no sort order. The order is undefined.