mysql 默认不区分大小写,如果需区分大小写,可使用以下方法
1. 查询字段前使用 binary
select * from table_name where binary id='ID_3nzKM1ekmDM'
2.设置字段属性区分大小写
alter table table_name modify column varchar(50) binary comment '备注' ;
alter table table_name modify column varchar(50) binary comment '备注'
这篇博客介绍了如何在MySQL中实现字段的大小写敏感查询,提供了两种方法:1) 使用`BINARY`关键字修饰查询字段;2) 修改字段属性为`BINARY`,确保在比较时区分大小写。这有助于在数据库操作中精确匹配字符串,特别是对于包含大小写敏感信息的数据。
3万+

被折叠的 条评论
为什么被折叠?



