小编Man*_*ani的帖子

在 mySql 中搜索带有空格的文本与 Query 匹配

我想用 [space] (Ascii 32) 作为其中的一部分在 mysql DB 中搜索文本。但我没有得到正确的结果。

我的 MySql 查询是:

SELECT count(id) as total
    , MIN(product_price) as min_price
    , MAX(product_price) as max_price 
FROM `products_details` 
WHERE subcat_id = 1026 
    AND MATCH(alternate_name, product_desc, keywords)
    AGAINST ('+moto +g +plus +(>mobile <mobiles)'; IN BOOLEAN MODE)
Run Code Online (Sandbox Code Playgroud)

我有以下问题:

AGAINST ('+moto +g +plus +(>mobile <mobiles)'

我想moto g plus使用上面的查询搜索字符串移动。我想在g. 例如,moto "SPACE"g"SPACE"

我尝试了以下 2 个解决方案,但它不起作用。

[[:空间:]]

AGAINST ('+moto +[[:space:]]g[[:space:]] +plus +(>mobile <mobiles)'

AGAINST ('+moto +\\ g\\ +plus +(>mobile <mobiles)' ==> 我在此查询中的 …

mysql subquery php mysql-5.6

2
推荐指数
1
解决办法
6138
查看次数

标签 统计

mysql ×1

mysql-5.6 ×1

php ×1

subquery ×1