Home > Database > Mysql Tutorial > mysql汉字按字母顺序排序_MySQL

mysql汉字按字母顺序排序_MySQL

WBOY
Release: 2016-06-01 13:18:51
Original
1084 people have browsed it

bitsCN.com

使用UTF8编码的数据表,查询直接使用Order by [column_name]这样的格式,查询结果排序并非拼音字母顺序,解决方法,使用CONVERT函数将中文编码改为GBK编码,

例如:SELECT * FROM table_name ORDER BYCONVERT(column_name USING gbk)


bitsCN.com
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template