SQL statements sorted alphabetically by Chinese pinyin

Source: Internet
Author: User

Oracle:

New in oracle9i, according to pinyin, radicals, stroke sorting function. Setting the Nls_sort value
Schinese_radical_m Sort by radical (first order), stroke (second order)
Schinese_stroke_m Sort by stroke (first order), radical (second order)
Schinese_pinyin_m by phonetic sorting, the default sorting method for the system is phonetic sorting

Examples are as follows:
The table name is dept, where the Name field is Chinese and the following are sorted by the stroke, radicals, and pinyin of the unit name.
Sort by stroke
SELECT * FROM Dept ORDER by Nlssort (name, ' Nls_sort=schinese_stroke_m ');
Sort by radical
SELECT * FROM Dept ORDER by Nlssort (name, ' Nls_sort=schinese_radical_m ');
Sort by pinyin, this is the default sort method for the system
SELECT * FROM Dept ORDER by Nlssort (name, ' Nls_sort=schinese_pinyin_m ');

Sql server


SQL statements sorted alphabetically by Chinese pinyin

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.