One named keywords with a keyword column. Another table domains with a column domain. I want to check if any of the keyword in the table keywords appear in domains or not?
How to go about it? I want to do the comparison using like operator. I tried this query
SELECT domain
FROM domains, keywords
WHERE keyword like concat('%',domain,'%')
But I always get empty set. For example I have a keyowrd shop and a domain named ‘www.dailyshop.com’. Now shop is within the said domain. So ‘www.dailyshop.com’ should be shown in query result. Please help
You need to swap the search columns. See Pattern Matching
e.g.