I have a table of company info (name, HQ country, etc) and a list of country names.
I want to see which companies have a country name in their company name, but ARE NOT headquartered in that country.
I have a simple SQL query to do it one at a time, but I want to write a query that passes all countries through.
Right now my where clause effectively looks like
WHERE company LIKE '%CANADA%'
AND hq_country_full != 'CANADA'
I tried using a subquery as well but could not figure this one out. I'm thinking I probably need to use a local variable but not sure how to set it up. Any help would be appreciated!