首页 > 数据库技术 > 详细

mysql查询区分大小

时间:2016-04-20 11:42:35      阅读:167      评论:0      收藏:0      [点我收藏+]

查询时加上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查询区分大小

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!