May order of rows in unordered query (like select * from smth) be different in different queries (in the same and not same session) if there are no updates to database table?
May order of rows in unordered query (like select * from smth ) be
Share
The order or rows returned from a query should never be relied upon unless you have included a specific
ORDER BYclause in your query.You may find that even without the
ORDER BYthe results appear in the same order but you could not guarentee this will be the case and to rely on it would be foolish especially when theORDER BYclause will fulfill your requirements.See this question: Default row ordering for select query in oracle
It has an excellent quote from Tom Kyte about record ordering.
So to answer your question: Yes, the order of rows in an unordered query may be different between queries and sessions as it relies on multiple factors of which you may have no control (if you are not a DBA etc.)
Hope this helps…