I'd like to insert a row into table A, but only if another row in table B exists. For example something like this...
IF EXISTS (SELECT * FROM B WHERE id=1)
INSERT INTO A
(id, value1, value2)
VALUES (1, 'foo', 'bar')
However that doesn't work. What will?