Suppose a SELECT query returns 10 rows. Is there any one line query such as this (which I tried but did not work) to select one random row from return results of a SELECT query -
select name from (select * my_table where age > 10 AS rows)
ORDER BY RAND() LIMIT 1;
Aucun commentaire:
Enregistrer un commentaire