Query to Sort alphanumerics in sql server 2005

Lakn2
Posted by Lakn2 under Sql Server category on | Points: 40 | Views : 1815
Hi Viewrs ,
This code is useful to sort data if we have data like
id
--
1
2
3
AED
20
ERF
....

select * from example Order By Case When IsNumeric(id) = 1   Then Right('0000000000000000000' + id, 20)  Else id End 

Comments or Responses

Login to post response