Customer service There is a need for me to some hotels in Chinese pinyin sorting, has not previously contacted, in the PHP group asked some Daniel. You get 2 answers, all of them. haha ~
The following is a MSYQL example, the table structure is utf-8
Method One,
Copy Code code as follows:
SELECT ' Hotel_name '
From ' Hotel_base '
ORDER by convert (' Hotel_name '
USING GBK)
COLLATE Gbk_chinese_ci
method Two,
Copy Code code as follows:
SELECT ' hotel_id ', ' Hotel_name ', ELT (INTERVAL (CONV HEX (' Hotel_name ')
USING GBK), 1)), 0xb0a1, 0xb0c5, 0xb2c1, 0xb4ee, 0xb6ea, 0XB7A2, 0xb8c1, 0xb9fe, 0xbbf7, 0xbfa6, 0xc0ac, 0 Xc2e8, 0XC4C3, 0xc5b6, 0xc5be, 0xc6da, 0XC8BB, 0xc8f6, 0xCBFA, 0xCDDA, 0xcef4, 0XD1B9, 0xd4d1), ' A ', ' B ', ' C ', ' D ', ' E ', ' F ', ' G ', ' H ', ' J ', ' K ', ' L ', ' M ', ' N ', ' O ', ' P ', ' Q ', ' R ', ' S ', ' T ', ' W ', ' X ', ' Y ', ' Z ', as PY
From Hotel_base
ORDER BY PY ASC
Method One more simple oh hope to the confused people have help ~ ~ ~