A lot of SQL code I've read, it seems like the developer assumes that the default sort order always holds. For example when building an HTML select list they would just SELECT id, name FROM table
without issuing an ORDER BY
clause.
From my own experience it seems like dbms alway orders data using FIFO if no ORDER BY
clause is given and no index. However, the order is not guaranteed. But I have never seen a dbms reordering data if there no change to the table.
Have you ever experienced a dbms selecting data in a non deterministic order if there is no change to the table?
Is it best practice to always put an ORDER BY clause?
question from:
https://stackoverflow.com/questions/1793147/sql-best-practice-to-deal-with-default-sort-order 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…