码迷,mamicode.com
首页 > 数据库 > 详细

mysql查询区分大小

时间:2016-04-20 11:43:16      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:mysql查询区分大小写

查询时加上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 |
+-------+

本文出自 “linux学习之路” 博客,请务必保留此出处http://raystudylinux.blog.51cto.com/9065684/1765634

mysql查询区分大小

标签:mysql查询区分大小写

原文地址:http://raystudylinux.blog.51cto.com/9065684/1765634

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!