For the query below, it currently selects from the table 50 records at random which have either job A or B. What I'm interested in is whether this can be modified to obtain 50 records at random while ensuring that an equal amount of people with job A and an equal amount of job B are selected i.e. 25 for each.
Is this possible within a single query?
"SELECT x, y, FROM table WHERE (job = 'A' OR job = 'B') ORDER BY RAND() LIMIT 50"
Any help/direction is greatly appreciated. I'm unsure where to begin searching as if you even attempt to look with keywords of 'where' and 'equal' you're directed to greater than or equal examples etc.