Hi,
I have a products table which apart from other things has a column called
manufacturer. I want to run a query that returns x number of products PER
manufacturer for each manufacturer that matches some criteria.
table::products
--------
id
name
cost
stock
manufacturer
I can only figure out how to limit it to 1, eg
"select manufacturer, name from products where manufacturer like 'A%' group
by manufacturer order by manufacturer, name"
which will return something like this
ManufacturerX, ProductA
ManufacturerY, ProductB
ManufacturerZ, ProductC
What I'd like to do is have something like this returned:
ManufacturerX, ProductA
ManufacturerX, ProductB
ManufacturerX, ProductC
ManufacturerY, ProductD
ManufacturerY, ProductE
ManufacturerY, ProductF
ManufacturerZ, ProductG
ManufacturerZ, ProductH
ManufacturerZ, ProductI
Depending on what limit I set per manufacturer.
Hope that makes some sense !