I have to sum the weight of the certain products, but they are in different lines of MySQL. How to do it?
Here is an example of my database:
ID | Product_id | weight_kg | Quantity |
1 | 201 | 6 | 3 |
2 | 102 | 3 | 1 |
3 | 103 | 4 | 4 |
4 | 200 | 2 | 1 |
5 | 201 | 6.3 | 7 |
6 | 205 | 1 | 7 |
For example I would like to know, how much is the weight of all the products starting with the product_id "2"(200,201,205).