I want to insert rows base on cell value in Column QuantityTable in Producttemp table and insert into table ProductionActual For example, the first table is shown below:
Table Producttemp
+-------------+----------+
| Requisition | Quantity |
+-------------+----------+
| GJ002_01_AD | 5 |
| GJ002_02_AD | 3 |
+-------------+----------+
and I would like the output to be as follows:
Table Productactual
+-------------+----------+----------+
| Requisition | Quantity | Series |
+-------------+----------+----------+
| GJ002_01_AD | 5 | 1 |
| GJ002_01_AD | 5 | 2 |
| GJ002_01_AD | 5 | 3 |
| GJ002_01_AD | 5 | 4 |
| GJ002_01_AD | 5 | 5 |
| GJ002_02_AD | 3 | 1 |
| GJ002_02_AD | 3 | 2 |
| GJ002_02_AD | 3 | 3 |
I found similar question below for sql server, but it's not working in MySQL database