Hi I have values like this in my field name called "NumberName"
AB1
CD2
XH506
PQ104
PZ77
I am trying to order this so far I have tried is:
select * from view_name where NumberName='Something'
order by RIGHT('0000' + SUBSTRING(NumberName, ISNULL(NULLIF(PATINDEX('%[0-9]%',NumberName), 0),
LEN(NumberName)+1), LEN(NumberName)), 4)
and
order by LEN(NumberName),NumberName
how to achieve this..?