sql - MySQL Check if row contains value from another table -


i need check if row in mysql table contains value stored in table.

this trying right now:

select * table1 not exists (select * table2 column = '%'); 

this still finds rows contain value in second table. have tried exchanging exists , in both return syntax errors.

edit:

using % sign seems cause issue. here screenshots of happens when use percent sign: enter image description here

one of values stored in second table 'meath', row containing 'meath' still selected. if add 'meath' instead of '%' row isn't returned: enter image description here

select * table1 a.county not in(select county table2) 

this should match want.

edit: if need disregard values table2, replace second line this

where a.county not in(select county table2 county in('county1', 'county2')) 

Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -