I have two MySQL table.
The first table has four column Date, Product, EX, Quantity. EX have three options RB,RC,RT
In the second table there are five columns - Date, Product, RB,RC,RT
RB, RC and RT are the SUM(MySQL) of the Quantity of a particular Product and Date getting from the first table.
For example if first table is follows:
Date | Product | EX | Quantity |
02.02.16 | P-1 | RB | 100 |
02.02.16 | P-1 | RB | 50 |
02.02.16 | P-1 | RC | 200 |
Then the second table will be like:
Date | Product | RB | RC | RT |
02.02.16 | P-1 | 150 | 200 | 0 |
So I want to run MySQL query and load the result instantly in the RB,RC and RT columns of the second table depending on the value enter in the Date and Product columns of the second table. How could I do that?
Please Help!