I have a an SQL table as follows:
>--------------------------
>|ID | AMOUNT | PRODUC_ID |
>--------------------------
>|1 | 100 | 5
>|2 | 100 | 5
>|3 | 100 | 5
>|4 | 100 | 10
>|5 | 100 | 10
>|6 | 100 | 10
>|6 | 100 | 10
Im using codeigniter, Im expecting to get the SUM OF AMOUTS according to the PRODUCT_ID dynamically. the required output is:
>sum of prodcut_id 5 = 300
>sum of prodcut_id 10 = 400