Question
Ordering mixed numeric / alphanumeric list
I have a list of "lotnumbers" in a varchar mySQL field
Data is mixed 103, 11, A3, G5, etc
Before the Lettered entries got dropped in the mix,
I was using "ORDER by CAST(lotNumber as SIGNED) "
which put the numeric entries into numeric order (1, 2, 3, etc)
but now that I have the letters in there, this is understandably
screwy... the mixed entries seem to be in no particular order
(D8, B8, C1, etc ) then the numeric entries below those in perfect order as before
the SQL "Order by LotNumber"
gives me the usual 1, 10, 100, 101, 102, etc, with the alpha-combo entries at the end, in order A1, A2, A3, etc... this is as
expected and I have left it in place for now
What is the correct "order by" syntax to get all of the numeric entries listed numerically, with the mixed alphanumeric entries
either before or after those (doesn't matter), in regular alphabetical order?
TIA
--
Michael Evangelista
Evangelista Design
www.mredesign.com
--
Data is mixed 103, 11, A3, G5, etc
Before the Lettered entries got dropped in the mix,
I was using "ORDER by CAST(lotNumber as SIGNED) "
which put the numeric entries into numeric order (1, 2, 3, etc)
but now that I have the letters in there, this is understandably
screwy... the mixed entries seem to be in no particular order
(D8, B8, C1, etc ) then the numeric entries below those in perfect order as before
the SQL "Order by LotNumber"
gives me the usual 1, 10, 100, 101, 102, etc, with the alpha-combo entries at the end, in order A1, A2, A3, etc... this is as
expected and I have left it in place for now
What is the correct "order by" syntax to get all of the numeric entries listed numerically, with the mixed alphanumeric entries
either before or after those (doesn't matter), in regular alphabetical order?
TIA
--
Michael Evangelista
Evangelista Design
www.mredesign.com
--
