Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Date Sort Order Incorrect!
I thought oracle ordered date columns by the full internal value of
the date (including seconds)
When I test this, it seems as if I am wrong!!!!
I'm guessing that Oracle applies the default date format mask to do the sort.
Is this correct? If it is then I am mad/sad.
Example:
desc plog:
action_code number
action_date date
select action_code,to_char(action_date,'DD-MON-YYYY
HH24:MM:SS'),action_date
from plog where vehicle_id=151855 order by action_date;
1 05-AUG-2004 16:08:37 05-AUG-04 1 05-AUG-2004 16:08:57 05-AUG-04 1 05-AUG-2004 16:08:51 05-AUG-04 <-- wrong! 16 05-AUG-2004 16:08:00 05-AUG-04 <-- in fact they are mostly wrong! 2 05-AUG-2004 19:08:45 05-AUG-04 2 05-AUG-2004 19:08:15 05-AUG-04 2 05-AUG-2004 19:08:32 05-AUG-04 11 05-AUG-2004 20:08:54 05-AUG-04
-- Kind regards, JamesReceived on Fri Aug 06 2004 - 02:55:38 CDT
![]() |
![]() |