with t(sorting) as (select 'S' from dual union all select 'M' from dual union all select 'L' from dual union all select '17' from dual union all select '10' from dual union all select '100' from dual ) select sorting from t order by decode(regexp_instr(sorting, '[A-Z|a-z]'), 0, to_number(sorting)), sorting ;