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
This article has been included on GitHub https://...
Table of contents Mixin Mixin Note (duplicate nam...
(?i) means do not match case. Replace all uppercas...
Worms replicate, as the name implies, by themselv...
This article summarizes some common MySQL optimiz...
1. Vulnerability Description On May 15, 2019, Mic...
I installed a new version of MySQL (8.0.21) today...
If you upgrade in a formal environment, please ba...
1. CSS3 animation ☺CSS3 animations are much easie...
<br />Now let's take a look at how to cl...
Table of contents Avoid repetitive rendering loop...
Problem Description Recently, a host reported the...
<br />This is from the content of Web front-...
The installation of the rpm package is relatively...
Canal is an open source project under Alibaba, de...