我有一个 MySQL 查询:
I have a MySQL query:
SELECT concat_ws(title,description) as concatenated HAVING concatenated LIKE '%SearchTerm%';
我的表使用 MyISAM 编码为 utf8_general_ci.
And my table is encoded utf8_general_ci with MyISAM.
搜索似乎区分大小写.
我不知道如何修复它.出了什么问题和/或我该如何解决?
I can't figure out how to fix it. What's going wrong and/or how do I fix it?
试试这个:
SELECT LOWER(CONCAT_WS(title,description)) AS concatenated
WHERE concatenated LIKE '%searchterm%'
或(让你看出区别)
SELECT LOWER(CONCAT_WS(title,description)) AS concatenated
WHERE concatenated LIKE LOWER('%SearchTerm%')
这篇关于像 MySQL 中区分大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!