title: Oracle SQL returns rows in arbitrary fashion when no "order by" clause is used
body: <p>Maybe someone can explain this to me, but when querying a data table from Oracle, where multiple records exist for a key (say a customer ID), the record that appears first for that customer can vary if there is no implicit "order by" statement enforcing the order by say an alternate field such as a transaction type.  So running the same query on the same table could yield a different record ordering than from 10 minutes ago.</p>
  
  <p>E.g., one run could yield:</p>
  
  <p>Cust_ID, Transaction_Type<br>
  123 A<br>
  123 B  </p>
  
  <p>Unless an "order by Transaction_Type" clause is used, Oracle could arbitrarily return the following result the next time the query is run:</p>
  
  <p>Cust_ID, Transaction_Type<br>
  123 B<br>
  123 A  </p>
  
  <p>I guess I was under the impression that there was a database default ordering of rows in Oracle which (perhaps) reflected the physical ordering on the disk medium.  In other words, an arbitrary order that is immutable and would guarantee the same result when a query is rerun.</p>
  
  <p>Does this have to do with the optimizer and how it decides where to most efficiently retrieve the data?</p>
  
  <p>Of course the best practice from a programming perspective is to force whatever ordering is required, I was just a little unsettled by this behavior. </p>