用户登录
用户注册

分享至

mysql 匹配 ~ 示例

  • 作者: 蝴蝶之舞飞啊飞
  • 来源: 51数据库
  • 2022-11-17

问题描述

下面是我坚持使用的一个示例 sql,它不会返回名为mill hotel"的酒店它返回其他 10 个酒店.任何帮助都会非常感谢

Below is an example sql I am stuck with, it will not return a hotel named "mill hotel" It returns 10 other hotels. Any help would be great thanks

SELECT * FROM tbl WHERE match(hotel) against('the mill hotel' IN BOOLEAN MODE) LIMIT 10";

<小时>

推荐答案

您需要指定运算符,因为在 OR 运算中没有指定任何结果.试试这个:

You need to specify the operators, because not specifying any results in an OR operation. Try this:

SELECT * FROM tbl WHERE match(hotel) against('+the mill hotel' IN BOOLEAN MODE) LIMIT 10";

阅读更多

软件
前端设计
程序设计
Java相关