Is there a collation to sort the following strings in the following order 1,2,3,6,10,10A,10B,11?
15
votes
4
answers
4954
views
I have a database with a VARCHAR column that contains integers of varying length. I want to sort them so 10 comes after 9, not 1, and 70A comes after 70. I was able do this with [PATINDEX()](http://msdn.microsoft.com/en-us/library/ms188395.aspx) , a CTE, and CASE statements in the WHERE clause.
However, I was wondering if there was a collation where this would be unecessary.
Asked by Justin Dearing
(2727 rep)
Jul 13, 2011, 05:15 PM
Last activity: Dec 15, 2022, 01:33 AM
Last activity: Dec 15, 2022, 01:33 AM