I have two tables: data and comments
data:
-------------------
id | name | email |
pics:
-------------------
msg_id | pic |
The data is assosiated by id and msg_id. How I can merge this two tables into final one?
Edit: some rows in data don’t have associated a pic, and i need to keep them.
You may want to use the
INSERT INTO ... SELECTsyntax:Example:
Your current data:
Your new table:
Result: