I have a database listing individuals and their qualifications. Unfortunately the qualifications are in one field and separated by semicolons--this is very limiting for the database and not ideal. I'm trying to query the table, loop through the rows, split the qualifications field, and insert them into a new table called qualifications.
The profile table looks like:
- id; a unique number, like: 5
- quals; semicolon separated field, like: cpr;firstaid;lifeguard
- additional fields that are irrelevant
It's not valid, but so far I have: INSERT INTO qualifications (id, qual) SELECT id, SPLIT(';', quals) FROM profile;
With the example data, I'm trying to insert three rows into the qualifications table:
5, cpr
5, firstaid
5, lifeguard