加载中...
加载中...
Oracle 对汉字加数字的字符串排序

Oracle 对汉字加数字的字符串排序 原创

需求:把下面的文件按照顺序进行排序,按照顺序打印。

3515029xxxxxxxxx0039账号2022年09月30日第1页电子对账单(人民币).pdf
3515029xxxxxxxxx0039账号2022年09月30日第2页电子对账单(人民币).pdf
3515029xxxxxxxxx0039账号2022年09月30日第3页电子对账单(人民币).pdf
3515029xxxxxxxxx0039账号2022年09月30日第13页电子对账单(人民币).pdf
3515029xxxxxxxxx0039账号2022年09月30日第11页电子对账单(人民币).pdf
3515029xxxxxxxxx0039账号2022年09月30日第4页电子对账单(人民币).pdf
3515029xxxxxxxxx0039账号2022年09月30日第5页电子对账单(人民币).pdf
3515029xxxxxxxxx0039账号2022年09月30日第10页电子对账单(人民币).pdf
3515029xxxxxxxxx0039账号2022年09月30日第12页电子对账单(人民币).pdf


Oracle 对汉字加数字的字符串排序只取数字的首位进行排序。

select
parent_id as "parentId",
file_name as "fileName",
file_path as "filePath",
ftp_path as "ftpPath"
from aims_reconciliation_file where 1=1
and PARENT_ID = 396
order by PARENT_ID,FILE_NAME;



思路:把第x页中页数提取出来,进行排序。

select
parent_id as "parentId",
file_name as "fileName",
file_path as "filePath",
ftp_path as "ftpPath"
from aims_reconciliation_file where 1=1
and PARENT_ID = 396
order by PARENT_ID,to_number(replace(regexp_substr(file_name,'[0-9]*[0-9]页'), '页'));






没有更多推荐了 [去首页]
image
文章
376
原创
293
转载
83
翻译
0
访问量
183398
喜欢
73
粉丝
5
码龄
7年
资源
3

文章目录

加载中...
0
0