This is because your internal query SELECT count(*) FROM ingredient WHERE Name = 'ingName'returns a value> 0, and therefore the top query SELECT 'ingName' FROM dummytable WHEREdoes not select any rows, and therefore no insertion occurs.
I tried the same thing with a test table having 2 columns name|valueand it worked great
INSERT INTO test1(name) (
SELECT 'name' FROM test2 WHERE
(
SELECT count(*) FROM test2 WHERE name = 'bilboa'
)
=0
)
2 name , select query 2 .