表中有条数据,SUBCLASSNAME的值为Dns
mysql中:
select t.* from test_subclass t where SUBCLASSNAME='DNS'
或select t.* from test_subclass t where SUBCLASSNAME='dns'
都可以查到数据,
在oracle中只有用select t.* from test_subclass t where SUBCLASSNAME='DNS'才能查到数据,
是否说mysql不区分大小写?
转篇文章:
http://blog.csdn.net/wp500/archive/2009/07/10/4336901.aspx
通过查询资料发现需要设置collate(校对) 。 collate规则:
*_bin: 表示的是binary case sensitive collation,也就是说是区分大小写的
*_cs: case sensitive collation,区分大小写
*_ci: case insensitive collation,不区分大小写
解决方法。
1.可以将查询条件用binary()括起来。 比如: select * from TableA where columnA like binary('aaa');
2. 可以修改该字段的collation 为 binary
比如:
ALTER TABLE TABLENAME MODIFY COLUMN COLUMNNAME VARCHAR(50) BINARY CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL;
解决该问题