I need to check if a row in a MySQL table contains a value stored in another table.
This is what I am trying right now:
SELECT * FROM table1 WHERE NOT EXISTS (SELECT * FROM table2 WHERE Column = '%');
SELECT * FROM table1 a WHERE a.County NOT IN(SELECT County FROM table2)
This should match what you want.
Edit: if you need to only disregard certain values from table2, you could replace the second line with this
WHERE a.County NOT IN(SELECT County FROM table2 WHERE County IN('county1', 'county2'))