MySQL: Insert row on table2 if row in table1 exists
- by Andrew M
I'm trying to set up a MySQL query that will insert a row into table2 if a row in table1 exist already, otherwise it will just insert the row into table1.
I need to find a way to adapt the following query into inserting a row into table2 with the existing row's id.
INSERT INTO table1 (host, path) VALUES ('youtube.com', '/watch') IF NOT
…