CRUD-区分大小写查询

CRUD-区分大小写查询

where查询

mysql> select * from t_emp where ename = "smith";
+-------+-------+-------+------+------------+--------+------+--------+
| empno | ename | job   | mgr  | hiredate   | sal    | comm | deptno |
+-------+-------+-------+------+------------+--------+------+--------+
|  7369 | SMITH | CLERK | 7902 | 1980-12-17 | 800.00 | NULL |     20 |
+-------+-------+-------+------+------------+--------+------+--------+

正常的where语句对字符串的查询都是不区分大小写的

区分大小写查询

mysql> select * from t_emp where binary ename = "smith";
Empty set (0.00 sec)

可以通过binary关键字进行查询

你可能感兴趣的:(CRUD-区分大小写查询)