I am running a long query that has a combination of results.
The results that I'm sorting by is the "Room Number". This room number
could be a number or even something like "Office". (This information
is used for schools, and their rooms aren't always labelled by true
numbers.).
The problem I am having is ... the numbers will not sort from actual
"highest to lowest". They go something like this: "1, 10, 11, 12, 13,
14, 15, 2, 20, 3, 4, 5, 6, 7, 8, Office, etc". I'd like to sort them
"ASCII-betically".
Is there anything in MySQL to assist me with this, or will I need to
code this in. This is an older project not written by myself and there
are many reworkings I'd have to do to get it to work as needed. So, a
quick addition to the SQL would be very nice.
Thank you.
The results that I'm sorting by is the "Room Number". This room number
could be a number or even something like "Office". (This information
is used for schools, and their rooms aren't always labelled by true
numbers.).
The problem I am having is ... the numbers will not sort from actual
"highest to lowest". They go something like this: "1, 10, 11, 12, 13,
14, 15, 2, 20, 3, 4, 5, 6, 7, 8, Office, etc". I'd like to sort them
"ASCII-betically".
Is there anything in MySQL to assist me with this, or will I need to
code this in. This is an older project not written by myself and there
are many reworkings I'd have to do to get it to work as needed. So, a
quick addition to the SQL would be very nice.
Thank you.
Comment