I have two mysql tables with a one-to-many relationship.
I want to find all rows in the 'one' table which do not have a row in the 'many' table and add a single row in the 'many' table for each one.
How can I edit my query to achieve this?
INSERT INTO many_table SET
id = ( SELECT id
FROM one_table
JOIN many_table ON one_table.id = many_table.related_id
WHERE many_table.related_id is null
)
name = 'george'