the table is like this
Product_Group value a 100 a 50 b 50 b 50 b 100 c 200 and I need to create a new column and at the same time take out the redundancy in Product_Group, so the result should be
Product_group Sum a 150 b 200 c 200 Cheers!
the table is like this
Product_Group value a 100 a 50 b 50 b 50 b 100 c 200 and I need to create a new column and at the same time take out the redundancy in Product_Group, so the result should be
Product_group Sum a 150 b 200 c 200 Cheers!
You can use Group BY Clause. However, this is not a good idea to use reseverd keyword SUM as a column name, but if you want to wrap in bracekts.
SELECT Product_group, SUM(Value) as [SUM] FROM tablename GROUP BY Product_group