Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with order when selecting
"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
Received on Wed Jul 07 2004 - 17:38:21 CDT