MySQL: What is a reverse version of LIKE?

前端 未结 3 2086
清酒与你
清酒与你 2020-11-27 06:00

LIKE operator in MySql is used to find rows that contain our query text, for example:

select name from user where name like \"%john%\"
3条回答
  •  猫巷女王i
    2020-11-27 06:21

    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, '%')
    

提交回复
热议问题