Compare Two Strings in MySQL

前端 未结 7 1734
走了就别回头了
走了就别回头了 2021-01-15 17:36

My current query (doesn\'t work)

SELECT url
FROM table
WHERE
    \'http://www.longurl.com/some/string\' like \'%\' . url . \'%\'

table

7条回答
  •  独厮守ぢ
    2021-01-15 18:20

    What about this:

    SELECT url 
    FROM table
    WHERE url LIKE '%longurl.com%string%'
    

    or, to be just like your PHP:

    SELECT url 
    FROM table
    WHERE url LIKE '%longurl.com%'
    

提交回复
热议问题