I'm trying to replicate the logic as show here. However, I'm not having any luck when there are joins. Below is a minimised version of my query:
SELECT resources.title, catRel.catRef
FROM resources
LEFT JOIN placesRel ON placesRel.refId = resId
LEFT JOIN catRel ON refId = resId
WHERE ...
In short, I'm getting a list, which contains category Ids and I want to limit the results to have no more than n results from a category, for example, show only two results per catRef:
title catRef
Swizz Gubbinz 1
Runcible Spoons 1
Peter Pan DVD 2
Button Moon 2
Monkey Alan 3
Bilge Pump 3