ranjan satpathy ranjan satpathy - 4 months ago 6
MySQL Question

MySQL to append all the column values

I have a table called

material_line_item
and in that table 3 columns are there
1.item_master_id
2.received_quantity
and
3.ordered_quantity
I want a Query to calculate all the quantities in both the fields (
received_quantity` and `ordered_quantity
) based upon the
item_master_id
.

**Screen Snap for this**

Answer

This should help:

SELECT item_master_id, sum(received_quantity), sum(ordered_quantity) FROM material_line_item
GROUP BY item_master_id