How to get the time in asc order ?
hello all,
I have a query that gives an output like below. I need the output according to the time , like it should sort by start and end time like 7AM-12PM,12PM-5PM,5PM-10PM,10PM-3AM,3AM-7AM.
Right now it is like this:-
select to_char(a.start_date,'mm/dd/yyyy hhAM') st,to_char(a.end_date,'mm/dd/yyyy hhAM')ed
from acntv.SHOWS a,intra.pbb_batch_sum b
where a.Start_date between
to_date('07242003070000','MMDDYYYYHH24MISS')
and to_date('07252003035959','MMDDYYYYHH24MISS')
and a.batch=b.batch(+)
group by to_char(a.start_date,'mm/dd/yyyy hhAM'),to_char(a.end_date,'mm/dd/yyyy hhAM')
ST ED
--------------- ---------------
07/24/2003 10PM 07/25/2003 03AM
07/24/2003 12PM 07/24/2003 05PM
07/24/2003 07AM 07/24/2003 12PM
07/25/2003 03AM 07/25/2003 07AM
07/24/2003 05PM 07/24/2003 10PM
Thanks