Group by Top x ? Consider a query like, e.g.
SELECT GROUP_CONCAT(id) FROM `products` GROUP BY `brand`;
Then the result will be product id string group by brand name
However, I want to limit the GROUP_CONCAT() only return the top 3
products of each brand, say, by price
How to do this?
Thanks. |