您的位置:首页 > 博客中心 > 数据库 >

MySQL查询时区分大小写

时间:2022-03-14 04:13

在创建MySQL数据库时,下面这些参数可供我们选择:
*_bin: 表示的是binary case sensitive collation,也就是说是区分大小写的 
*_cs: case sensitive collation,区分大小写 
*_ci: case insensitive collation,不区分大小写 

 

默认的选择是不区分大小写的

但有时我们的查询中的确需要明确的区分大小写,

这里介绍一种方法:在查询中使用binary关键字

select  * from  table_name where  binary  a like  ‘A%‘ 

热门排行

今日推荐

热门手游