2 Replies Latest reply: Mar 4, 2013 3:43 AM by _Karthick_ RSS

    Case In The Group By cluses

    M.Hassan_999
      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