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關鍵字進行查詢

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