当前位置:网站首页>Oracle 中文排序 Oracle 中文字段排序
Oracle 中文排序 Oracle 中文字段排序
2022-07-05 18:33:00 【HaHa_Sir】
Oracle 中文排序 Oracle 中文字段排序
一、情景描述
1、在实际开发中,遇到字段排序的情况,大概如下:

2、正序的需求是: 一类、二类、三类 ; 倒序需求是: 三类、二类、一类。
3、从图中可以看到,使用默认的排序,达不到预期效果,那么 Oracle中,对于中文排序该如何处理呢?
二、问题解决
1、使用 nlssort 函数,解决中文排序问题。
2、Oracle9i之前,中文是按照二进制编码进行排序的。在oracle9i中新增了按照拼音、部首、笔画排序功能。设置NLS_SORT值:
- SCHINESE_RADICAL_M :按照部首(第一顺序)、笔划(第二顺序)排序
- SCHINESE_STROKE_M :按照笔划(第一顺序)、部首(第二顺序)排序
- SCHINESE_PINYIN_M : 按照拼音排序,系统的默认排序方式为拼音排序
3、举例如下:
//按照笔划排序
select * from dept order by nlssort(name,'NLS_SORT=SCHINESE_STROKE_M');
//按照部首排序
select * from dept order by nlssort(name,'NLS_SORT=SCHINESE_RADICAL_M');
//按照拼音排序,此为系统的默认排序方式
select * from dept order by nlssort(name,'NLS_SORT=SCHINESE_PINYIN_M');
4、案例截图:

边栏推荐
- 2022最新Android面试笔试,一个安卓程序员的面试心得
- Common time complexity
- LeetCode 6111. 螺旋矩阵 IV
- Interprocess communication (IPC): shared memory
- Reading notes of Clickhouse principle analysis and Application Practice (5)
- Memory leak of viewpager + recyclerview
- 瞅一瞅JUC提供的限流工具Semaphore
- Various pits of vs2017 QT
- Share: ZTE Yuanhang 30 Pro root unlock BL magick ZTE 7532n 8040n 9041n brush mask original brush package root method Download
- IDEA配置npm启动
猜你喜欢

集合处理的利器

Icml2022 | partial and asymmetric comparative learning of out of distribution detection in long tail recognition

ViewPager + RecyclerView的内存泄漏
![[HCIA cloud] [1] definition of cloud computing, what is cloud computing, architecture and technical description of cloud computing, Huawei cloud computing products, and description of Huawei memory DD](/img/b8/624799e4bf788e4476b155486f478b.png)
[HCIA cloud] [1] definition of cloud computing, what is cloud computing, architecture and technical description of cloud computing, Huawei cloud computing products, and description of Huawei memory DD

2022最新Android面试笔试,一个安卓程序员的面试心得

The 10th global Cloud Computing Conference | Huayun data won the "special contribution award for the 10th anniversary of 2013-2022"

The 11th China cloud computing standards and Applications Conference | cloud computing national standards and white paper series release, and Huayun data fully participated in the preparation

@Extension, @spi annotation principle

IDEA配置npm启动

Use QT to traverse JSON documents and search sub objects
随机推荐
The origin of PTS, DTS and duration of audio and video packages
IDEA配置npm启动
让更多港澳青年了解南沙特色文创产品!“南沙麒麟”正式亮相
The 11th China cloud computing standards and Applications Conference | China cloud data has become the deputy leader unit of the cloud migration special group of the cloud computing standards working
进程间通信(IPC):共享内存
Powerful tool for collection processing
U-Net: Convolutional Networks for Biomedical Images Segmentation
Overview of video self supervised learning
Idea configuring NPM startup
Linear table - abstract data type
[HCIA cloud] [1] definition of cloud computing, what is cloud computing, architecture and technical description of cloud computing, Huawei cloud computing products, and description of Huawei memory DD
技术分享 | 接口测试价值与体系
Writing writing writing
一文读懂简单查询代价估算
The 2022 China Xinchuang Ecological Market Research and model selection evaluation report released that Huayun data was selected as the mainstream manufacturer of Xinchuang IT infrastructure!
解决 contents have differences only in line separators
一朵云开启智慧交通新未来
The worse the AI performance, the higher the bonus? Doctor of New York University offered a reward for the task of making the big model perform poorly
How to write good code defensive programming
Record eval() and no in pytoch_ grad()