oracle按照拼音排序,ORACLE根据中文拼音首字母排序、取得中文拼音首字母函数

根据中文拼音首字母排序、取得中文拼音首字母函数

介绍根据中文的首字母、笔画、部首排序函数【NLSSORT】:

1)、首字母

SELECT * FROM T_TABLE ORDER BY NLSSORT(NAME, 'NLS_SORT=SCHINESE_PINYIN_M');

2)、笔画

SELECT * FROM T_TABLE ORDER BY NLSSORT(NAME, 'NLS_SORT=SCHINESE_STROKE_M');

3)、部首

SELECT * FROM T_TABLE ORDER BY NLSSORT(NAME, 'NLS_SORT=SCHINESE_RADICAL_M');

列表一行汉字

WITH A AS

(SELECT '获取汉字拼音首字母' W FROM DUAL)

SELECT SUBSTR(W, ROWNUM, 1) FROM A

CONNECT BY ROWNUM <= (SELECT LENGTH(W) FROM A);

返回结果

用汉字字符集对这个列表进行排序

WITH A AS  -www.2cto.com-

(SELECT '获取汉字拼音首字母' W FROM DUAL)

SELECT SUBSTR(W, ROWNUM, 1) FROM A

CONNECT BY ROWNUM <= (SELECT LENGTH(W) FROM A)

ORDER BY NLSSORT(SUBSTR(

你可能感兴趣的:(oracle按照拼音排序)