Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-01-27 : 07:43:48
|
| Phil writes "how do you order by an alphanumeric column. One such as:Column------123a3b4567891011a11betc.Thanks,Phil" |
|
|
ehorn
Master Smack Fu Yak Hacker
1632 Posts |
Posted - 2004-01-27 : 09:26:58
|
| [code]create table test ( data varchar(10))insert into testselect '1'union all select '2'union all select '7'union all select '8'union all select '9'union all select '10'union all select '3a'union all select '3b'union all select '4'union all select '5'union all select '6'union all select '11a'union all select '11b'select datafrom testorder by case when isnumeric(right(data,1))=0 then convert(int,left(data,len(data)-1)) else data end drop table test[/code] |
 |
|
|
|
|
|