📚 开源资源分享——颜佐光的个人书架
✉️ 联系站长
书架 / mysql / 语法

MySQL查询时区分大小写

2021-07-15 09:35 · 约 316 字 · 浏览 2,249 次语法

MySQL查询时区分大小写

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

默认的选择是不区分大小写的,但有时我们的查询中的确需要明确的区分大小写。这里介绍一种方法:在查询中使用binary关键字:

select  * from  table_name where  binary  a like  'A%' 
← 返回《mysql》目录书架 →