mysql中文字段排序( 按拼音首字母排序)的查询语句

如果数据表tbl的某字段name的字符编码是latin1_swedish_ci

select * from `tbl` order by birary(name) asc ;

 

如果数据表tbl的某字段name的字符编码是utf8_general_ci

 

SELECT name FROM `tbl` WHERE 1 ORDER BY CONVERT( name USING gbk ) COLLATE gbk_chinese_ci ASC

 

===================

$orderby="convert(`group` USING gbk) COLLATE gbk_chinese_ci,displayorder,navid"

posted @ 2013-01-29 15:27  幻星宇  阅读(412)  评论(0编辑  收藏  举报