日期:2014-05-17 浏览次数:20987 次
select 'oracle'||max(to_number(replace(val, 'oracle', ''))) maxval from t;
------解决方案--------------------
如果都是以“oracle”+数字,用这种方法是没有问题的
SELECT SubStr(id,1,6)||Max(To_Number(SubStr(id,7,Length(id)))) FROM test GROUP BY SubStr(id,1,6);
------解决方案--------------------
with t as (select 'oracle123' name from dual union all select 'oracle2' name from dual union all select 'oracle45' name from dual union all select 'oracle9' name from dual) select * from (select t.name from t order by to_number(regexp_substr(t.name,'\d+')) desc) where rownum=1;