MYSQL select 2 random rows from each categories
问题 I have a mysql table with columns like this: `qid`, `category`, `question`, `choice_1`, `choice_2`, `choice_3`, `answer` In this table I have 2000 data and there are 7 different 'category'. I want to fetch 15 random rows from this table with equal number from each category. Since I have 7 categories, it's not possible to get equal number of rows from each category. In this case I can get 3 from one category. How can I achieve that with one query? I was thinking of getting 2 rows from each