SELECT a.id AS supplier, sum( processed_weight ) AS total_qty
FROM supplier_inward a
INNER JOIN warehouseb ON a.id = b.supplier
WHERE a.master_product_id = '38'
GROUP BY b.supplier
output present
supplier total_qty
12046 475.00
12482 99.00
output needed
total_qty
574.00
here i need the sum(total_qty) in this query? how to achieve this
Just modify
GROUP BY, addingWITH ROLLUP:Output: