我在MySQL中使用LOCATE()函数进行高级搜索时遇到问题。我想搜索 mala kaju vish 等文字。 在MySQL Query snippiest下面
SELECT Id,quetion FROM tblName WHERE status='s'
AND (quetion LIKE '%mala%' AND quetion LIKE '%kaju%' AND quetion LIKE '%vish%')
OR
(quetion LIKE '%mala%' AND quetion LIKE '%kaju%')
OR
(quetion LIKE '%mala%' OR quetion LIKE '%kaju%' OR quetion LIKE '%vish%')
ORDER BY
LOCATE("mala",quetion ),LOCATE("kaju",quetion ),LOCATE("vish",quetion)
预期输出将在 quetion 列中找到与 mala kaju vish 文本匹配的所有文字。