我要字符串中相应月份和年份的最后日期。
'opimus_rise_issue_command_201912.txt'预期产出--
20191231发布于 2019-10-23 12:46:30
一些嵌套函数可能会有所帮助。
SQL> with test (col) as
2 (select 'opimus_rise_issue_command_201912.txt' from dual)
3 select to_char(last_day(to_date(regexp_substr(col, '\d+'), 'yyyymm')), 'yyyymmdd') result
4 from test
5 /
RESULT
--------------------------------------------------
20191231
SQL>发布于 2019-10-23 12:52:44
看看这个
select LAST_DAY(to_date(regexp_replace('opimus_rise_issue_command_201912.txt', '[^0-9]', '') ||'01','yyyymmdd')) from dual;2011年12月31日
https://stackoverflow.com/questions/58523101
复制相似问题