The following method requires oracle9i and more versions to support it.
Before Oracle9i, Chinese is sorted according to binary encoding.
In oracle9i, according to pinyin, radical, stroke sorting function. Set Nls_sort value
Schinese_radical_m sorted by radical (first order), stroke (second order)
Schinese_stroke_m sorted by stroke (first order), radical (second order)
Schinese_pinyin_m
Sort by Pinyin, the system's default sort method is phonetic sorting
Examples are as follows:
The table name is dept, where the Name field is Chinese, and the following is the order of strokes, radicals, and pinyin by company name.
1://Sort by stroke
2:select * FROM Dept ORDER by Nlssort (name, ' Nls_sort=schinese_stroke_m ');
3://Sort by radical
4:select * FROM Dept ORDER by Nlssort (name, ' Nls_sort=schinese_radical_m ');
5://
Sort by Pinyin, this is the default sorting method for the system
6:select * FROM Dept ORDER by Nlssort (name, ' Nls_sort=schinese_pinyin_m ');
Note that the SQL directive is not a standard instruction and is not implemented the same way below SQL Server.
To sort the names of the people who are queried according to the first letter of Pinyin
Select * from Ryjbqk where (XM -like '%¸ß% ' or xm-like '%´þ% ' or< /c6> xm like '%ºâ% ') and Ryid not in (select Ryid from rc_ Zsdj where czt= ' 1 ') ORDER by Nlssort (XM, ' Nls_sort=schinese_pinyin_m ')