The following method is supported by Oracle9i and later.
Before Oracle9i, Chinese characters were sorted by binary encoding.
The sorting by pinyin, radical, and stroke function is added to Oracle9i. Set the nls_sort Value
Schinese_radical_m is sorted by the beginning (first order) and strokes (Second Order ).
Schinese_stroke_m is sorted by strokes (first order) and heads (Second Order ).
Schinese_pinyin_m
Sort by pinyin The default sorting method is pinyin sorting.
Example:
The table name is Dept, where the name field is Chinese. The following lists the strokes, radicals, and Pinyin of the unit names. 1: // Sort by strokes
2: Select * From dept order by nlssort ( Name , 'Nls _ sort = schinese_stroke_m' );
3: // Sort by department heads
4: Select * From dept order by nlssort ( Name , 'Nls _ sort = schinese_radical_m' );
5: //Sort by pinyin, Which is the default sorting method of the system.
6: Select * From dept order by nlssort ( Name , 'Nls _ sort = schinese_pinyin_m' );
Note that this SQL command is not a standard command and is implemented in different ways in sqlserver.
Sort the queried personnel names by the first letter of the pinyin alphabet.
Select *FromRyjbqkWhere(XMLike '% Dynamic Route %' OrXMLike '%' Percent %' OrXMLike '% ° Â %' )AndRyidNot In(SelectRyidFromRc_zsdjWhereCZT = '1' )Order ByNlssort (XM, 'Nls _ sort = schinese_pinyin_m' )