本文介绍了像MySQL中的区分大小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个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中的区分大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 10:29