Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.