8 Replies Latest reply: Sep 9, 2018 10:23 PM by Quy Nguyen RSS

    Concat and Count

    Beck Bakytbek

      Hi Folks,

       

      i got a situation:

       

      temp:

      OrderID, Product, Turnover

      101, Road Bikes, 25

      101, Chains, 25

      102, Road Bikes, 5

      102, Footwear, 15

      103, Chains, 7

       

      left join

      load OrderID, Concat(Product, ' , ' ) as Product

      resident temp

      group by OrderID;

       

      my resultstable does look like:

       

      OrderID, Products, Turnover

      101, Road Bikes, Chains, 50

      102, Road Bikes, Footwear, 20

      103, Chains, 7

       

       

      I want to have such tables

      OrderID, Products, Turnover

      101, 2, 50

      102, 2, 20

      103, 1, 7

       

      How to implement the ProductsName into Number?

      Does anybody have any idea?

       

      Thanks a lot

      Beck