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 |
|
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2009-09-18 : 15:26:36
|
| What can i do to order by a varchar field.Select picklisttext from picklisttable order by picklisttextI am getting the data this way: After EA1 it should be EA2 but it is showing EA10:******EA1EA10EA11EA12EA13EA14EA15EA16EA17EA18EA19EA2EA21EA22EA23EA24EA25EA26EA27EA29******Thank you very much for the helpful info. |
|
|
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts |
Posted - 2009-09-18 : 18:30:43
|
| It is sorting the data exactly as it is supposed to. The seeming discrepancy is that it is using a alphabetic ordering while you are assuming that it will recognize some of the characters as being numeric and impose a non-alphabetic ordering.If it is possible to know what this string looks like (e.g., two letters followed by digits) it might be possible to impose the ordering that you require.=======================================Men build too many walls and not enough bridges. -Isaac Newton, philosopher and mathematician (1642-1727) |
 |
|
|
|
|
|