S
Sten
Guest
Hi all,
I am working on a application to automatically generate quizzes. I have all of my data broken up into catergories, for instance:
Red
Blue
Green
Now I want to generate a test of 15 questions that take 5 random Red, 5 random Blue, and 5 Random green questions. My problem is I can get 5 random questions from any single catergory, but I can't figure out how to get them all. I thought about doing 3 different queries, and then a forth query that calls them all. Then I realized in the future I may add new catergories and would have to redo the query every time. I was thinking of a for each statement? Any ideas would be greatly appreciated.
Thank You,
Sten
I am working on a application to automatically generate quizzes. I have all of my data broken up into catergories, for instance:
Red
Blue
Green
Now I want to generate a test of 15 questions that take 5 random Red, 5 random Blue, and 5 Random green questions. My problem is I can get 5 random questions from any single catergory, but I can't figure out how to get them all. I thought about doing 3 different queries, and then a forth query that calls them all. Then I realized in the future I may add new catergories and would have to redo the query every time. I was thinking of a for each statement? Any ideas would be greatly appreciated.
Thank You,
Sten