mysql Query
Posted: Wed Mar 18, 2009 3:29 am
Hello Friends .
I am doing a project in php based on inventory management. I have a table in my database called goods i.e.,
Table : goods
D S W
9 68 75
9 68 75
9 72 100
9 72 100
9 75 150
9 75 150
10 78 200
10 78 200
10 78 200
Now i want a query that returns the values as follows
D S W
9 68 150 //[75+75 =150]
9 72 200 //[100+100=200]
9 75 300 //[150+150=300]
10 78 600 //[200+200+200=600]
How to write the mysql query for this.
Can any one please help me.
If not plz give me some idea how to do this.
I am doing a project in php based on inventory management. I have a table in my database called goods i.e.,
Table : goods
D S W
9 68 75
9 68 75
9 72 100
9 72 100
9 75 150
9 75 150
10 78 200
10 78 200
10 78 200
Now i want a query that returns the values as follows
D S W
9 68 150 //[75+75 =150]
9 72 200 //[100+100=200]
9 75 300 //[150+150=300]
10 78 600 //[200+200+200=600]
How to write the mysql query for this.
Can any one please help me.
If not plz give me some idea how to do this.