Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: Mysql Like Case Sensitive
Mysql 忽略大小写的 LIKE 比较。
如何强制它执行区分大小写的 LIKE 比较?
使用LIKE BINARY:
LIKE BINARY
mysql> SELECT 'abc' LIKE 'ABC'; -> 1 mysql> SELECT 'abc' LIKE BINARY 'ABC'; -> 0
另一种选择是使用COLLATE,
COLLATE
SELECT * FROM table1 WHERE columnName like 'a%' COLLATE utf8_bin;