Name: Anonymous 2008-04-25 5:41
Sup,
I'm currently struggling to have my rows sorted in a MySQL database. I'm trying to get 'é' handled like 'e' when it comes to sorting. Instead, I get it either at the start or the end of the list (tried a few collations) or between 'a' and 'b' (with utf8_general_ci). I can understand why it could be taken as first or last element but why it sits in the middle of nowhere is completely beyond me but if anyone knows a collation that could help me, please tell me.
Test case:
create database test charset utf8 collate utf8_general_ci;
create table test.test (
id int unsigned auto_increment primary key,
name varchar(255) charset utf8 collate utf8_general_ci
) engine=InnoDB charset utf8 collate utf8_general_ci;
insert into test.test value (1,'aa'),(2,'ab'),(3,'bb'),(4,'ea'),(5, 'éb'),(6, 'ec');
select * from test.test order by name;
select * from test.test order by id;
drop database test;
Expected result: both selects should have the same result set.
I'm currently struggling to have my rows sorted in a MySQL database. I'm trying to get 'é' handled like 'e' when it comes to sorting. Instead, I get it either at the start or the end of the list (tried a few collations) or between 'a' and 'b' (with utf8_general_ci). I can understand why it could be taken as first or last element but why it sits in the middle of nowhere is completely beyond me but if anyone knows a collation that could help me, please tell me.
Test case:
create database test charset utf8 collate utf8_general_ci;
create table test.test (
id int unsigned auto_increment primary key,
name varchar(255) charset utf8 collate utf8_general_ci
) engine=InnoDB charset utf8 collate utf8_general_ci;
insert into test.test value (1,'aa'),(2,'ab'),(3,'bb'),(4,'ea'),(5, 'éb'),(6, 'ec');
select * from test.test order by name;
select * from test.test order by id;
drop database test;
Expected result: both selects should have the same result set.