Respected Techie,
May someone please help me how to acheive this.
/*
sum of Net Product Sales for each salesperson_number in a sales_group for a given month
I am looking for all the column but group by only on sales_group
*/
Declare @table1 table
(
Month VARCHAR (5),
SALES_GROUP VARCHAR (20)
SALES_NUMBER NUMERIC (10,0)
[Net Product Sales] FLOAT
)
insert @table1
SELECT '8', 'E' , '9298', '14.89' UNION ALL
SELECT '8', 'E' , '9298', '99.3' UNION ALL
SELECT '8', 'E' , '9290', '24.29' UNION ALL
SELECT '8', 'E' , '9290', '58.78' UNION ALL
SELECT '7', 'E' , '9298', '138.66' UNION ALL
SELECT '7', 'E' , '9298', '286.81' UNION ALL
SELECT '7', 'E' , '9298', '125.29' UNION ALL
SELECT '7', 'E' , '9299', '76.91' UNION ALL
SELECT '7', 'E' , '9299', '90.5' UNION ALL
SELECT '7', 'E', '9299', '43.19'
Result