MySQL: What is a reverse version of LIKE?

Here’s a way you can achieve what you describe:

SELECT name FROM user 
WHERE 'John Smith and Peter Johnson are best friends' LIKE
  CONCAT('%', name, '%')

Leave a Comment