MySql question:
What is the difference between [NOT] IN and [NOT] EXIST when doing subqueries in MySql.
They work very differently:
However both can be used to check if a row in table A has a matching row in table B. Unless you are careful and know what you are doing I would stay clear of IN in MySQL as it often gives much poorer performance on more complex queries. Use NOT EXISTS or a LEFT JOIN ... WHERE ... IS NULL.