johnsmith153 Posted August 13, 2010 Share Posted August 13, 2010 How would I ORDER BY when the column can contain a number either 1,2,3,4 but I want to return in this order 1,4,2,3 Strange I know but it's easier to change the query than other things. Link to comment https://forums.phpfreaks.com/topic/210600-order-by-slightly-different/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 13, 2010 Share Posted August 13, 2010 http://dev.mysql.com/doc/refman/5.1/en/string-functions.html#function_field ORDER BY FIELD(your_column,1,4,2,3) You can also use the FIND_IN_SET() function to accomplish the same thing. Link to comment https://forums.phpfreaks.com/topic/210600-order-by-slightly-different/#findComment-1098698 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.