Depending on your data, it is not guaranteed to give you the same data in the same order each time. Imagine these situations:
1) The "cemp" table contains more than 9 rows with the same "smallest" status. The order of the rows within this status will be totally dependant on what is already in cache and which blocks get read first from disk etc. As a result your ordering is not specific enough.
2) You only have nine rows of the same "smallest" status. The same rows would be returned each time, but the order of the rows is not guaranteed.
These are two very specific cases, but the problem can obviously be much bigger.
Unless you specify an order that guarantees the order of each row, you CAN NOT assume Oracle will return the data in the same order each time.
Just an off the cuff statement used as an extrapolation of the "whatever the DB can get access to first" idea. It wouldn't surprise me if it has some truth in it, but I have no evidence and I will try and keep my unproved theories to myself in future.
Unless you specify an order that differentiates between each row, Oracle will give you the data back in "no specific order". If all your data is in a single block then it will appear that the order is fixed, until a time when the data is no loger contained in a single block.
The thing to remember here is, "If you want it in a specific order use an ORDER BY clause that *guarantees* that order, rather than relying on guesswork."
Bookmarks