如果数据表table的某字段name的字符编码是utf8_general_ci :
 
SELECT *  FROM `table` ORDER BY convert(name USING gbk) COLLATE gbk_chinese_ci asc ;

mysql按汉语拼音首字母排序的更多相关文章

  1. SQL按汉语拼音首字母排序

    以常用到的省的数据表(province)为例,其中name字段为省的名称,SQL语句如下: ))) as py ,a.name from province a left outer join ( se ...

  2. mysql根据汉字首字母排序[转]

    select  areaName  from area order by   convert(areaName USING gbk)   COLLATE   gbk_chinese_ci asc 说明 ...

  3. mysql中文名字按首字母排序

    在mysql数据库中可以使用GBK编码对中文进行排序,如名字按首字母排序 order by convert(substr(tu.username,1,1) using 'GBK') 其中substr方 ...

  4. mysql、oracle 中按照拼音首字母排序

    mysql中按照拼音首字母排序 convert(name using gbk) ASC 注:name 为字段名称 oracle中按照拼音首字母排序 nlssort(enterprise_name,'N ...

  5. mysql排序的中文首字母排序和自定义排序

    select * FROM organ_new where city_code = 'SZ0755' and organ_type = 'H' and state = '1' ORDER BY FIE ...

  6. php按照中文首字母排序

    1> 网络上很多php的工具类可以将汉字转为拼音: 2> 将拼音进行排序即可 另一种则是类似mysql转码方式: 1 foreach ($array as $key=>$value) ...

  7. 原生Js汉语拼音首字母匹配城市名/自动提示列表

    根据城市的汉语名称首字母把城市排序,基本思路: 1.处理数据,按照需要的格式分别添加{HOT:{hot:[],ABCDEFG:{a:[1,2,3],b:[1,2,3]},HIGHLMN:{},OPQR ...

  8. 联系人的侧边字母索引ListView 将手机通讯录姓名通过首字母排序。

      package com.lixu.letterlistview; import java.util.ArrayList; import java.util.List; import org.apa ...

  9. 获取手机通讯录放入PinnedSectionListView中,按名字首字母排序,并且实现拨打电话功能。

    package com.lixu.tongxunlu; import java.util.ArrayList; import com.lixu.tongxunlu.PinnedSectionListV ...

随机推荐

  1. 记一次Nginx 400错误

      在一个非CDN的域名下有一个页面,需要请求CDN域名下的资源.所以在CDN的那台源站的Nginx上设置了 add_header 'Access-Control-Allow-Headers' 'X- ...

  2. 每日英语:Success Outside the Dress Code

    Anyone who has felt like the odd duck of the group can take heart from new research from Harvard Bus ...

  3. axis2带list的报文,对象和xml的转换

    import java.util.ArrayList; import java.util.List; import org.apache.log4j.Logger; import org.dom4j. ...

  4. Eclipse远程调试HDP源代码

    使用的是自己编译的HDP2.3.0的源代码编译的集群,此文介绍如何使用Eclipse远程调试Hadoop内核源代码,以调试namenode为例进行介绍. 在/usr/hdp/2.3.0.0-2557/ ...

  5. Swing How to make dialogues

    There are two types of dialog: modal non-modal: must use JDialog directly Taken JFileChooser as Exam ...

  6. [Javascript] Limit Built Branches on Travis

    By default, Travis will build all branches, tags, and Pull Requests. Because we're building our mast ...

  7. [原创]自定义view之:快速开发一款Material Design风格的dialog的开源项目MDDialog

    随着google开始主导Material Design风格的设计,越来越多的app开始使用Material Design风格来设计自己的UI.虽然在Android Studio中集成了多种快速开发框架 ...

  8. Spring AOP Schema aop:config、tx:advice

    Spring AOP Schema  aop:config.tx:advice 一.      利用aop:config标签实现AOP 首先看个例子,如下 接口代码: package com.lei. ...

  9. Spring3系列8- Spring 自动装配 Bean

    Spring3系列8- Spring 自动装配 Bean 1.      Auto-Wiring ‘no’ 2.      Auto-Wiring ‘byName’ 3.      Auto-Wiri ...

  10. table变宽格式

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...