使用mysql搜索时如何忽略大写和小写之间的区别 [英] How can I ignore the difference between upper and lower case when searching with mysql
本文介绍了使用mysql搜索时如何忽略大写和小写之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用mysql搜索时,如何忽略大写和小写之间的区别
How can I ignore the difference between upper and lower case when searching with mysql
推荐答案
执行以下操作:
SELECT user
FROM users
WHERE UPPER( user ) = UPPER( 'moustafa' );
基本上,您是将结果转换为一种大小写,然后与也会转换为大写的搜索词进行比较,从而有效地忽略了大小写.
Basically you're converting your result to one case and comparing against the search term which is also converted to upper case, effectively ignoring case.
这篇关于使用mysql搜索时如何忽略大写和小写之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文