That won't work. See the query below:DECLARE @tempfun TABLE(col1 varchar(10))INSERT INTO @tempfunSELECT '10th' UNION ALLSELECT '1st' UNION ALLSELECT '4th' UNION ALLSELECT '2nd' UNION ALLSELECT '3rd' UNION ALLSELECT '11th'SELECT *FROM @tempfunORDER BY LEN(col1)
This will, assuming that there is a 2 character suffix on each record:DECLARE @tempfun TABLE(col1 varchar(10))INSERT INTO @tempfunSELECT '10th' UNION ALLSELECT '1st' UNION ALLSELECT '4th' UNION ALLSELECT '2nd' UNION ALLSELECT '3rd' UNION ALLSELECT '11th'SELECT *FROM @tempfunORDER BY Convert(int, Left(col1, len(col1) - 2))