Group By Title????Please Help!!!!!!! - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Group By Title????Please Help!!!!!!!

I would like to group the output by "Shift"
Please Help!!!!!!!

select count(*),TIME,
SUBSTR('ABABABABCDCDCDCDBABABABADCDCDCDC',(FLOOR(MOD((24*((TIME)-TO_DATE('2000, 01, 04,07, 00, 00','YYYY, MM, DD, HH24, MI, SS'))/12),32))+1),1) as "SHIFT"
from PROB.TEST
where time>=to_date('01/06/2002 00:00:00','dd/mm/yyyy hh24:mi:ss')
and time<to_date('04/06/2002 00:00:00','dd/mm/yyyy hh24:mi:ss')
group by TIME, "SHIFT"

I know this last line is wrong - Any ideas!!!

Comments

  • YuviYuvi Posts: 1Member
    hi

    try to give "shift" within single quotes


    : I would like to group the output by "Shift"
    : Please Help!!!!!!!
    :
    : select count(*),TIME,
    : SUBSTR('ABABABABCDCDCDCDBABABABADCDCDCDC',(FLOOR(MOD((24*((TIME)-TO_DATE('2000, 01, 04,07, 00, 00','YYYY, MM, DD, HH24, MI, SS'))/12),32))+1),1) as "SHIFT"
    : from PROB.TEST
    : where time>=to_date('01/06/2002 00:00:00','dd/mm/yyyy hh24:mi:ss')
    : and time<to_date('04/06/2002 00:00:00','dd/mm/yyyy hh24:mi:ss')
    : group by TIME, "SHIFT"
    :
    : I know this last line is wrong - Any ideas!!!
    :
    :

Sign In or Register to comment.