Detailed explanation of MySQL sorting Chinese characters By default, MySQL only supports sorting of dates, times, and English strings. If you use order by on Chinese characters, you may not get the desired results. For example, the following query will not sort by the pinyin of Chinese characters as we want: SELECT * from user order by user_name; If you want to sort relative to Chinese, you can use CONVERT (coloum_name USING GBK) to convert Chinese to GBK encoding, and then sort, you can sort according to the pinyin of Chinese: SELECT * from user order by CONVERT(user_name USING GBK); Thank you for reading, I hope it can help you, thank you for your support of this site! You may also be interested in:
|
<<: Linux command line quick tips: How to locate a file
>>: In-depth understanding of javascript class array
High CPU load caused by MySQL This afternoon, I d...
css3 background image related Compatibility: IE9+...
Table of contents 1. Docker installation on Mac 2...
You can easily input Chinese and get Chinese outp...
This article introduces blue-green deployment and...
The <input> tag The <input> tag is us...
<br />First think of the idea, then draw a s...
HTML is made up of tags and attributes, which are...
3D coordinate concept When an element rotates, it...
Table of contents 1. Project Description: 2. Proj...
Table of contents 1. Introduction to binlog 2. Bi...
Table of contents 1. Basic use 2. Several points ...
I am using LDAP user management implemented in Ce...
Recently, due to business adjustments in the comp...
The docker image id is unique and can physically ...