I have a MySQL table containing domain names:
+----+---------------+ | id | domain | +----+---------------+ | 1 | amazon.com | | 2 | google.com |
You can use the column on the right of the like too:
SELECT domain FROM table WHERE 'www.google.com' LIKE CONCAT('%', domain);
or
SELECT domain FROM table WHERE 'www.google.com' LIKE CONCAT('%', domain, '%');
It's not particularly efficient but it works.