Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with order when selecting
"Jim Kennedy" <kennedy-downwithspammersfamily_at_attbi.net> wrote in message news:<xX_Gc.42044$IQ4.41187_at_attbi_s02>...
> "Roman Klesel" <rupa_at_firemail.de> wrote in message
> news:slrnceotkp.pau.rupa_at_gemini.office.noris.de...
> >
> > Dear SQL hackers,
> >
> > I would like to do the following:
> >
> > select
> > to_char(first_time),
> > count(first_time)
> > from v$log_history
> > group by to_char(first_time)
> > order by first_time
> >
> > Unfortunately this does not work.
> > However when I:
> >
> > order by to_char(first_time)
> >
> > I don't get the order I want.
> >
> > Can some one please show me how this is ment to work!
> >
> > Thanks in advance.
> >
> > Roman Klesel
> >
> to_char means you want to do a character ordering not a date ordering. You
> might try
> to_char(first_time,'yyyymmddhh24miss')
> Jim
Or try this:
select
to_char(first_time), count(first_time) from v$log_history group by to_char(first_time) order by to_date(to_char(first_time));Received on Thu Jul 08 2004 - 04:45:56 CDT