with this query :
SELECT a.nid, a.stock, b.qty
FROM uc_product_stock a
INNER JOIN uc_order_products b ON a.nid = b.nid
I have the following result:
nid stock qty
11 256 4
11 256 1
11 256 4
11 256 1
11 256 1
10 746 1
10 746 2
10 746 1
now i want to sum qty column with same id 11 and 10 i.e my result should be
nid stock qty
11 256 11
10 746 4