Home >Database >Mysql Tutorial >mysql进行中文拼音排序_MySQL

mysql进行中文拼音排序_MySQL

WBOY
WBOYOriginal
2016-06-01 13:45:33956browse

bitsCN.com

[size=large]mysql 按照中文的拼音实现排序:

Java代码 
CREATE TABLE test1( 
id INT NOT NULL, 
NAME VARCHAR(20), 
PRIMARY KEY(id) 
); 

排序代码:使用的函数:convert(列名 USING 字符集)
Java代码 
SELECT * FROM test1 ORDER BY CONVERT(NAME USING gbk) DESC; 
[/size]

 

本文出自“wangboak”
 

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn