If the field storing the name uses the GBK character set, then it will be easy to deal with, because the GBK internal code itself uses the pinyin sorting method when encoding (the 3755 commonly used first-level Chinese characters are sorted by pinyin, while the second-level Chinese characters are not, but considering that people's names are commonly used Chinese characters, it is sufficient to just sort the first-level Chinese characters correctly). Directly add order by name asc after the query statement; the query results are sorted in ascending order by last name; If the field storing the name uses the utf8 character set, the field needs to be converted when sorting; the code is order by convert(name using gbk) asc; Similarly, the query results are sorted in ascending order by last name; The above simple example of MySQL sorting according to the pinyin of Chinese characters is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: js to achieve interesting countdown effect
>>: Solution to the welcome to emergency mode message when booting CentOS7.4
Table of contents Initialize MySQL Install MySQL ...
This article introduces in detail some of the tech...
This article shares the installation and configur...
In daily operation and maintenance work, nginx se...
vue-cli uses stimulsoft.reports.js (nanny-level t...
After Vmvare sets the disk size of the virtual ma...
We often need to summarize data without actually ...
Table of contents 1. Example: this can directly g...
1. Introduction I recently upgraded my blog and a...
Detailed explanation of the solution to garbled c...
Table of contents 1: Single machine password-free...
If you already have some kind of password policy ...
Table of contents Overview Precautions 1. Usage 2...
1. Concept Analysis 1: UE User Experience <br ...
question How to modify CSS pseudo-class style wit...