Inte det snabbaste i världen, men det borde få jobbet gjort:
ORDER BY CASE WHEN PTNT_VST_CSNO LIKE 'vmi%' THEN 0 ELSE 1 END
,CAST(replace(replace(PTNT_VST_CSNO, 'vmip', ''), 'vmop', '') as int)
Inte det snabbaste i världen, men det borde få jobbet gjort:
ORDER BY CASE WHEN PTNT_VST_CSNO LIKE 'vmi%' THEN 0 ELSE 1 END
,CAST(replace(replace(PTNT_VST_CSNO, 'vmip', ''), 'vmop', '') as int)