I am confused by a query in Oracle that returns randomly.
SELECT Date, Amount FROM MyTable WHERE Date = '26-OCT-2010' ORDER BY Date
This returns the following data:
| Date | Amount -------------------------- 1 | 26-OCT-10 | 85 2 | 26-OCT-10 | 9 3 | 26-OCT-10 | 100
I cannot understand why the database returns data in this particular order or why, since the original table will return the data in this way.
Dropping the Date in TIMESTAMP confirms that all Date values have the same value - 26-OCT-10 00.00.00.000000000 , so I can exclude that there is a difference in the values. However, when I do this, the rows are returned in the order 1, 3, 2.
It drives me crazy, so it really helps reassure me if anyone can explain why this is so.
I would expect this to be returned in a different order each time the query is executed, given that the order legend is the same for each row (thus leaving the order clean).
Thank you very much in advance.
oracle sql-order-by
Dan atkinson
source share