I never ceased to amaze me when I was a database administrator that this SQL feature was so often considered fancy. Consider a simple program that works with a text file and produces some output. If the program never changes and the data never changes, you expect the output to never change.
Regarding this:
If the ORDER BY clause is not included in the query, the returned row order is undefined.
Not strictly true - on every DBMS I have ever worked with (Oracle, Informix, SQL Server, DB2, to name a few), the DISTINCT clause also has the same effect as ORDER BY, since the search for unique values โโincludes sorting by definition .
EDIT (6/2/14):
Create a simple table

For DISTINCT and ORDER BY, both plans and costs are the same, because supposedly the same operation is performed


And it is not surprising that the effect is thus the same

Robbie dee
source share