© 2024 fjorge. All rights reserved.
Ordering mysql results by certain field value first

I needed to order a mysql result but in a somewhat custom way.
Say there is a field "id" and rows of values of 8, 4, 2, and 19.
This would obviously return the order: 2,4,8,19.
But what if you needed the 4 to be first and then order by integers?
This would return 4,2,8,19.
Simple and can be really helpful.