SELECT * FROM `user` WHERE name LIKE ‘a%‘; SELECT * FROM `user` WHERE name LIKE ‘A%‘;其结果是一样的,为了区分‘A%‘和‘a%‘,可以这么做:
SELECT * FROM `user` WHERE binary name LIKE ‘a%‘; SELECT * FROM `user` WHERE binary name LIKE ‘A%‘;仅仅多了一个binary,就可以得到不同的结果!
create table `user`( name varchar (20) binary );
MySQL查询时强制区分大小写,布布扣,bubuko.com
原文地址:http://blog.csdn.net/zyb_icanplay7/article/details/24981791