mysql 中的like查找不忽略大小写
2015-12-17 20:59
525 查看
like默认情况下是忽略大小写的,但是加上collate latin1_general_cs就可以避免这种情况了
例子如下:
The following two statements illustrate that string comparisons are not case sensitive unless one of the operands is a case sensitive (uses a case-sensitive collation or is a binary string):
mysql>
-> 1
mysql>
-> 0
mysql>
-> 0
mysql>
-> 0
例子如下:
The following two statements illustrate that string comparisons are not case sensitive unless one of the operands is a case sensitive (uses a case-sensitive collation or is a binary string):
mysql>
SELECT 'abc' LIKE 'ABC';
-> 1
mysql>
SELECT 'abc' LIKE _latin1 'ABC' COLLATE latin1_general_cs;
-> 0
mysql>
SELECT 'abc' LIKE _latin1 'ABC' COLLATE latin1_bin;
-> 0
mysql>
SELECT 'abc' LIKE BINARY 'ABC';
-> 0
相关文章推荐
- 解决MySQL5.6 Warning: Using a password on the command line interface can be insecure
- C#读取mysql表
- java代码与mysql语句的一些优化
- mysql 判断表字段是否存在,然后修改
- mysql5.6版本安装步骤详解
- 阿里云 Ubuntu 14.04 安装mysql 5.6
- MySQL 5.7 新特性详解
- mysql 安装问题
- mysql insert_select ID 自增长
- MySQL 忘记密码后的重置操作
- Mysql String Functions
- mysql5.6源码安装
- mysql Table 'performance_schema.session_variables' doesn't exist
- mysql复制
- MySQL安装包
- Mysql安装步骤
- mysql 安装与配置
- 老李分享:loadrunner操作mysql数据库
- mysql 基于LVM快照的备份
- 老李分享:MySql的insert语句的性能优化方案