第一种情况:英文或汉字集中在前头或后头
--- 英文消失,只保留了数字
select regexp_replace(a.XXX,'[^0-9]') as detail from xxx a;--- 排序,转成数字排序
select * from xxx a where 条件 order by to_number(regexp_replace(a.XXX,'[^0-9]')) desc;
第二种情况:数字在中间,也可以用 regexp_replace
--- 比如说:第1笔 第1张之类的
select * from xxx a where 条件 order by to_number(regexp_replace(a.XXX,'[^0-9]')) desc;--- 这种缺点就是要固定汉字
select * from xxx a where 条件 order by to_number(replace (replace( a.XXX,'第',''),'笔',''));
第三种情况汉字排序
--- 按照拼音排序
select * from xxx a where 条件 order by NLSSORT(a.XXX, 'NLS_SORT=SCHINESE_PINYIN_M');
第四种情况 NULL值排在最后头,正序排序的时候null会在最前面
select * from xxx a where 条件 order by desc a.XXX nulls last;