I have a table 'Cases' with a field string field called 'Tags', which contains tags seperated by | character:
Cases
+----+-------------------+
| Id | Tags |
+----+-------------------+
| 12 | "car|plane|truck" |
| 11 | "plane" |
+----+-------------------+
and I would like to create a new Table to map these Tags as follow:
Tags
+----+---------+-------+
| Id | case_id | tag |
+----+---------+-------+
| 1 | 12 | car |
| 2 | 12 | plane |
| 3 | 12 | truck |
| 4 | 11 | plane |
+----+---------+-------+
How do I write an sql statement to create each record on the table as described above?
Thanks!