How to write a group by when there is a "case" in SQL
495327Mar 13 2006 — edited Mar 13 2006Hi,
I got a case stmt in the sql and need to be grouped but it is giving out the error "not a GROUP by" function. I tried all the possibilities, any one please help!!
the case is
case when ?timezone?='PST' then case when t."c13"
between TO_DATE('040301' ,'MMDDHH24' ) and
TO_DATE('103000' ,'MMDDHH24' ) then ((t."c13") +
((0.0416667*1.0e0))+((0.0416667*1.0e0))) else ((t."c13") +
((0.0416667*1.0e0))) end else case when
((t."c13") + ((0.0416667*1.0e0))) between
TO_DATE('040301' ,'MMDDHH24' ) and TO_DATE('103000'
,'MMDDHH24' ) then ((((t."c13") +
((0.0416667*1.0e0))+((0.0416667*1.0e0)))) + ((0.0416667*1.0e0))) else
((t."c13") + ((0.0416667*1.0e0))+((0.0416667*1.0e0))) end end
what we need to give in the group by clause.
Thanks in advance,
GK