If I have a query like this:
INSERT INTO map
SELECT 5, product_id FROM products WHERE price < 500 )
Say this tries to insert 300 rows into the map table. Say 20 of the inserts generate duplicate key errors. Will the other 280 rows be inserted or will the entire query fail?
If so, what is the best way to write this query so that the non-duplicate rows are inserted and the duplicates are ignored?