mysql match against multiple words

前端 未结 2 1744
醉酒成梦
醉酒成梦 2021-01-01 19:41

Below is an example sql I am stuck with, it will not return a product named \"iphone 4s\", It returns 10 other result. Any help would be great thanks

1st sql exampl

2条回答
  •  感动是毒
    2021-01-01 20:36

    To match an exact phrase, just use double quotes to surround the phrase to match;

    SELECT * 
    FROM products 
    WHERE MATCH(desc) 
          AGAINST('"iphone 4s"' IN BOOLEAN MODE) 
    LIMIT 10
    

    More info at the manual pages.

提交回复
热议问题