Basically, the following is what I wish to do:
INSERT INTO table
(
column1, column2
)
VALUES
(
?, ?
)
WHERE EXISTS
(
SELECT 1
FROM table2
WHERE id = ?
)
In other words: provided an id exists in table2, the values should be inserted, otherwise nothing should happen.
What is the correct syntax for this task?