Here is a sample table.
ColZero | ColOne | RoColTwo
--------+--------+--------
1 | one | tag1
2 | two | tag1
3 | three | tag2
4 | four | tag2
5 | five | tag3
I have the following query.
SELECT `ColOne` FROM `Table` WHERE `ColTwo` = ? ORDER BY rand() LIMIT 1;
I'd like to select multiple rows, using multiple values of RowTwo in a single query but each row still has to be random.
This involves merging a variable number of instances of this query into a new, single query.
How can this be done in one query? (I am trying to make this as quick as possible, so getting it all done in one request, as opposed to 10-30 requests is a big plus.)