This discussion is archived
2 Replies Latest reply: Mar 4, 2013 1:43 AM by Karthick_Arp RSS

Case In The Group By cluses

M.Hassan_999 Newbie
Currently Being Moderated
I Need To Group By Case having sub query is it possible
/*******************************************************************************/
select
segment3,

( case when segment3 like '210%' and segment4 in ( select child_m from apps.XXNBE_PAR_PROD) then (select parent_m from apps.XXNBE_PAR_PROD where segment4=child_m) else ' ' end ) AS PC,

sum(br_egp) IN_BR_EGP

from apps.XXNBE_FIN_R7 R7

group by

segment3

,( case when segment3 like '210%' and segment4 in ( select child_m from apps.XXNBE_PAR_PROD) then (select parent_m from apps.XXNBE_PAR_PROD where segment4=child_m) else ' ' end );

/*******************************************************************************/
It's Returne The Error subquery expressions not allowed here

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points