I want to modify table in my production server by extracting some column and put it into another table, the problem is the old column has multiple value separated by commas and in new table will be put in multiple records by query.
i know the way like INSERT INTO user_emails(user_id, email) SELECT id, email FROM users
but it would copy entire content of field.
table users (old)
-----------------------------------------------------
id name emails (removed)
-----------------------------------------------------
1 A [email protected], [email protected]
2 B [email protected], [email protected], [email protected]
table user_emails (new table)
---------------------------------
id user_id email
---------------------------------
1 1 [email protected]
2 1 [email protected]
3 2 [email protected]
4 2 [email protected]
5 2 [email protected]
Any solution? Thank you