I have seen many topics on this subject, and I have not been successful in understanding how to do this.
For example, if I have this table:
+------+-------+-------+
| id | name | class |
+------+-------+-------+
| 5 | test | one |
| 10 | test2 | one |
| 12 | test5 | one |
| 7 | test6 | two |
+------+-------+-------+
and I want to show random only X lines from the class "one", how can I do this?
note: its a large table, so I don't want to use ORDER BY RAND.
source
share