jeudi 6 octobre 2016

Select random row in MySQL with condition

I would like to know if it's possible to select random row with special condition...

I explain myself:

select 3 row with attribut isTrue = 0 but in my 3 row i want one with isTrue = 1

I've a table "reponse" like:

Table Reponse

I would like to do something like that: SELECT * FROM reponse WHERE isTrue = 0 (and one of row(isTrue = 1) ORDER BY RAND() LIMIT 3

I don't know if you realy understood what i want to do PS: I'm french




Aucun commentaire:

Enregistrer un commentaire