Click here to Skip to main content
15,919,245 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Model	Category   Color	MRP	Input_Pairs	

SY001	Sports	   Black	100	30
SY004	Sports	   Red	        500	20
SY001	Sports	   Black	100	10	
SY001	Sports	   Red   	800	300	


i want to add same color ,same model mrp and input_Paires
how to add value

example:- sy001 have 3 value but black color two value it show
like that

XML
Model   Category   Color    MRP Input_Pairs

SY001   Sports     Black    200 40
SY004   Sports     Red      500 20
SY001   Sports     Red      800 300

and so on..

please help me

Thank in advance
Posted
Updated 4-Nov-12 2:18am
v2

1 solution

Did you SQL query having SUM function?

Something like:
SQL
SELECT 
   Model,
   Category,
   Color,
   SUM(MRP),
   SUM(Input_Pairs)
FROM
   MyTable
GROUP BY 
   Model, Category, Color
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900