I need to sample a group of products. Products belong to some Form. Form can be mapped to some catalogs.
For example, form=1523 is mapped to catalog =5 and catalog=8
I need to run on a specific form and to bring maximum 750 products from each catalog.
I thought of using limit (RowNum<=750*number of catalogs) but I don't understand how I can limit per catalog and not the total query result.
Also, I don't have a previous knowledge of how many catalogs there are in a specific form.
For example, lets say i want only 2 rows per each catalog. My sample is:
Product Form Catalog
-----------------------
1 50 5
2 50 6
3 50 6
4 50 6
How can I get a result of product 1 and 2 random products from catalog 6?
LIMIT ??somehow?