当前位置:网站首页>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、案例截图:
边栏推荐
- Case sharing | integrated construction of data operation and maintenance in the financial industry
- 7-1 linked list is also simple fina
- Use of websocket tool
- Pytorch yolov5 training custom data
- Einstein sum einsum
- [QNX Hypervisor 2.2用户手册]6.3.2 配置VM
- Insufficient picture data? I made a free image enhancement software
- Lombok @builder annotation
- vs2017 qt的各种坑
- 小程序 修改样式 ( placeholder、checkbox的样式)
猜你喜欢
IDEA配置npm启动
Pytorch yolov5 training custom data
Trust counts the number of occurrences of words in the file
RedHat7.4配置yum软件仓库(RHEL7.4)
瞅一瞅JUC提供的限流工具Semaphore
让更多港澳青年了解南沙特色文创产品!“南沙麒麟”正式亮相
解决 contents have differences only in line separators
Idea configuring NPM startup
ConvMAE(2022-05)
Introduction to the development function of Hanlin Youshang system of Hansheng Youpin app
随机推荐
jdbc读大量数据导致内存溢出
A2L file parsing based on CAN bus (3)
English sentence pattern reference
7-2 保持链表有序
一文读懂简单查询代价估算
AI open2022 | overview of recommendation systems based on heterogeneous information networks: concepts, methods, applications and resources
7-2 keep the linked list in order
Lombok @builder annotation
Reading notes of Clickhouse principle analysis and Application Practice (5)
个人对卷积神经网络的理解
【HCIA-cloud】【1】云计算的定义、什么是云计算、云计算的架构与技术说明、华为云计算产品、华为内存DDR配置工具说明
2022年阿里Android高级面试题分享,2022阿里手淘Android面试题目
Nacos distributed transactions Seata * * install JDK on Linux, mysql5.7 start Nacos configure ideal call interface coordination (nanny level detail tutorial)
[PM2 details]
Use QT to traverse JSON documents and search sub objects
进程间通信(IPC):共享内存
【在优麒麟上使用Electron开发桌面应】
一朵云开启智慧交通新未来
Logical words in Articles
技术分享 | 接口测试价值与体系