查询时加上binary关键词就能在查询时区分字符大小如下:
mysql> select name from pe where binary name=‘Claws‘;
+-------+
| name |
+-------+
| Claws |
+-------+
mysql> select name from pe where binary name=‘claws‘;
Empty set (0.00 sec)
like条件的使用:
mysql> select name from pe where name like binary ‘c%‘;
Empty set (0.00 sec)
mysql> select name from pe where name like binary ‘C%‘;
+-------+
| name |
+-------+
| Claws |
+-------+
时间: 2024-11-06 03:48:01