我需要一个SQL查询来拉动所有相关的“网球礼品”产品使用mysql匹配(索引:fulltext),但我得到以下错误时,使用substring_index只获得类别部分从product_attributes来匹配Tennis Gifts
串如何使用substring_index匹配
product_attributes值= { “类别”: “网球>礼品>项链”, “四季”:{ “月”: “一月”, “二月”]}}
select product_code
from products
where match(substring_index(substring_index(product_attributes, 'category', -1), '"', 1)) against ('Tennis Gifts' IN NATURAL LANGUAGE MODE)
错误
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(substring_index(product_attributes, 'category', -1), '"', 1)) ' at line 3
我如何才能匹配搜索词的类别值,感谢任何帮助。提前致谢。
有一个在这个问题上没有PHP的。 'php'标签是无关紧要的。 –