oracle 的nls_sort和nlssort 排序功能

 在oracle9i中新增了按照拼音、部首、笔画排序功能。设置NLS_SORT值
	SCHINESE_RADICAL_M 按照部首(第一顺序)、笔划(第二顺序)排序
	
	SCHINESE_STROKE_M  按照笔划(第一顺序)、部首(第二顺序)排序
	
	SCHINESE_PINYIN_M 按照拼音排序
	
	拼音  SELECT * FROM TEAM ORDER BY NLSSORT(队 名,'NLS_SORT=SCHINESE_PINYIN_M')
	
	笔划  SELECT * FROM TEAM ORDER BY NLSSORT(队名,'NLS_SORT=SCHINESE_STROKE_M ')
	
	部首  SELECT * FROM TEAM ORDER BY NLSSORT(队名,'NLS_SORT=SCHINESE_RADICAL_M ')
	
	
	例如:
		with t as (
		  select '测试' nm from dual union all
		  select '测验' from dual union all
		  select '丁丁' from dual union all
		  select '仓库' from dual )
		select nm from t order by nlssort(nm,'nls_sort=SCHINESE_STROKE_M');


你可能感兴趣的:(oracle)