In the mysql tutorial on Chinese sort is a more interesting question, especially for the field is uft-8 or not gbk, gb2312 field type is Chinese sort out there is a problem, let's look at an example.
create table `test111cnnet` (
`bid` int (4) unsigned not null auto_increment,
`namerean` varchar (20) character set gbk default null,
primary key (`id`)
); Save some data
insert into `test1` (` id`, `namerean`) values ('Li');
insert into `test1` (` id`, `namerean`) values ('Deng');
insert into `test1` (` id`, `namerean`) values ('station');
mysql tutorial> select namerean fromtest111cnnetorder by namerean;
Deng (d)
Lee (l)
Station (z)
This looks mysql Chinese sort is no problem, because our namerean is gbk encoding, so the result is satisfactory, then if uft-8 is not alright, so we constructed a,
select namerean from test111cnnet order by convert (namerean using gb2312) asc; In this way, no matter what the current field encoding, he can sort well according to the Chinese pinyin.