Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Date Sort Order Incorrect!

Re: Date Sort Order Incorrect!

From: Peter Marksteiner <pm_at_katz.cc.univie.ac.at>
Date: 06 Aug 2004 08:17:05 GMT
Message-ID: <41133e81$0$29350$3b214f66@usenet.univie.ac.at>


James <thanatic_at_telstra.com> wrote:
: I thought oracle ordered date columns by the full internal value of
: the date (including seconds)

It does.

: select action_code,to_char(action_date,'DD-MON-YYYY
: HH24:MM:SS'),action_date

       ^^

Probably that should be MI, not MM: I suppose you want minutes, not months.

: 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
I suppose they are all right.

-- 
Peter Marksteiner
Vienna University Computer Center
Received on Fri Aug 06 2004 - 03:17:05 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US