I want to insert the values in a column from one table to another but the values of the first table are stored in a single string, separated by commas. I have to insert all values automatically without specifying the id, hence creating the following.
TABLE_1
ID_TRA | COND
------------
100 | 1,2,4
101 | 4
102 | 1, 16 <--- TRIM SPACE
TABLE_2
ID | ID_TRA | COND_ID
---------------------
1 | 100 | 1
2 | 100 | 2
3 | 100 | 4
4 | 101 | 4
5 | 102 | 1
6 | 102 | 16
Note
The id needs to be auto incremented as it's being inserted