Oracle
1、sql排序
#字符串替换
SELECT replace('C123~','~','') as int from dual;
CAST ("REPLACE"(REPLACE (sp.plantNumber, '~', ''), 'C', '') AS INT) ASC #排序
#是否包含某个字符
SELECT instr('1','~') from dual;
INSTR (sp.plantNumber, '~') DESC #排序
#获取字符串中指定字符
select REGEXP_SUBSTR ('12~', '[0-9]*') from dual;
TO_NUMBER (REGEXP_SUBSTR (sp.plantNumber, '[0-9]*')) ASC, #排序
#筛选指定字符串
select TRIM (TRANSLATE ('C1','C0123456789~',' ')) from dual ;