1 Reply Latest reply: Aug 27, 2014 3:47 AM by Joseph Simmons RSS

    How to use group by

      Hi

      I have a dataset

      col1 col2   amount  policynumber

      01     01       500              45

      01    01        600              45

      01    02        500              50

      01   01        400               50

      03   01        800               60

       

      I need to match the col1 and col2 and group

       

      I created a temp table

      LOAD * INLINE [

      KEY

      01-01

      01-02;

       

       

      Table:

      Load

      ------

      Where Exists(KEY, [Tran-Type]&'-'& [Acct-Ln]);Where Exists(KEY, [Tran-Type]&'-'& [Acct-Ln]);

       

      now I want to group amount by policy numbers.Here i want to exclude 03 -1 policy number i.e 60

       

      Thanks

        • Re: How to use group by
          Joseph Simmons

          Hi Pavan,

           

          not sure I get what you are after but the below is basically how you would do a group by statement and check col1 vs col2 is equal

           

           

          Test:

          Load

          policynumber,

          Sum(amount) As amount

           

          Resident Table

          Where col1=col2

          Group by policynumber

          ;

           

          hope that helps

          Joe