CRUD-区分大小写查询 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关键字进行查询

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章