lundi 5 janvier 2015

MySQL Query, make ORDER BY rand() put a specific row in the bottom

I have an



ORDER BY rand()


SQL query for choosing a random row in my table, is there a possibilty to make so that it wont choose a specific row? For example, if I have a column called "Boolean" in the table, and I only want to have the



rand()


choose the rows where "Boolean" is equal to "1", and put the rest in the bottom, is that possible?


Sorry if this is a stupid question, or if Ive explained it badly, but Im pretty new to SQL.





Aucun commentaire:

Enregistrer un commentaire