Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to write a group by when there is a "case" in SQL

495327Mar 13 2006 — edited Mar 13 2006
Hi,
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 10 2006
Added on Mar 13 2006
10 comments
5,811 views