Tag Archives: order by

Order SQL query manually when numeric string representation is out of order

In some instances, doing a straight ORDER BY ASC (OR DESC) does not work as one might want: 0-50 101-200 201-300 301-400 401-500 501-600 51-100 601+ That is not how humans do it 😉 A way to get around this, is to add a new column and put in an ordering value, for instance: 1. 0-50 2. 51-100 3. 101-200 4. 201-300 5. 301-400 6. 401-500 7. 501-600 8. 601+ Now that is much better 🙂 Here is a real