我只需要替换数字并保留剩余部分。例子:
34HUNTAVE ==> 34THUNTAVE
1232432GRACE ST ==> 1232432NDGRACE ST
1232433GRACE ST ==> 1232433RDGRACE ST
问题是 Julian 格式在大数字上给出错误。我怎样才能使它工作。
Does Not Work
------------
SELECT REGEXP_REPLACE ('10425222GRACEST','[[:digit:]]+',
TO_CHAR (TO_DATE (REGEXP_REPLACE ('10425222GRACEST','[^[:digit:]]'),'J'),'fmJTH')) FROM dual;
Works Fine
----------
SELECT REGEXP_REPLACE ('10425BCST','[[:digit:]]+',
TO_CHAR (TO_DATE (REGEXP_REPLACE ('10425BCST','[^[:digit:]]'),'J'),'fmJTH')) FROM dual;