How to get sum from joined table B with multiple results againts one row in table A?

If I correctly understood, you want the total quantity and not the different locations'quantity. You could achieve this joining with the summed quantity in stockq. I'm not sure about mysql sintax but this query should do the job select * from spareparts S join (select ITEMID, sum(quantity) as quantity from stockQ group by ITEMID) as Q on S.

ITEMID = Q.ITEMID.

Perfect, thank you. BTW: I erroneusly tagged MySQL since it is the most common database I work with. The one in question here is Oracle 10g, but it really makes no difference.

– heikkim Nov 25 '10 at 12:25.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions