1
create database mysqltest collate = utf8_bin;
3
create table t1 (a varchar(10));
4
create table t2 (a varchar(10)) collate = utf8_general_ci;
5
insert into t1 values ('a'),('A'),('aA'),('Aa'),('ab'),('Ab');
6
insert into t2 values ('a'),('A'),('aA'),('Aa'),('ab'),('Ab');
7
select * from t1 order by a;
15
select * from t2 order by a;
25
t1 CREATE TABLE `t1` (
26
`a` varchar(10) COLLATE utf8_bin DEFAULT NULL
30
t2 CREATE TABLE `t2` (
31
`a` varchar(10) DEFAULT NULL
33
select count(*) from t1 where a='a';
36
select count(*) from t2 where a='a';
39
select count(*) from t1 where a like 'a%';
42
select count(*) from t2 where a like 'a%';
45
drop table if exists t1;
46
drop table if exists t2;
47
drop database if exists mysqltest;