Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- column sorting, grouping, ordering and randomising all at once


Wayder - 12:31 am on Jul 21, 2010 (gmt 0)


I came up with the following

ORDER BY (my_number = 0 OR my_number > 5) DESC, RAND(),my_number ASC, RAND()

Do you know a better/alternate way?


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/4173650.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com