按中文首个拼音字母排序的sql语句如何写

网络整理 - 07-27

  如果数据表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