I am trying to reproduce the logic as shown here . However, I was not lucky when there are associations. The following is a summary 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 get a list containing category identifiers, and I want to limit the results to no more than n results from the category, for example, show only two results on catRef:
title catRef Swizz Gubbinz 1 Runcible Spoons 1 Peter Pan DVD 2 Button Moon 2 Monkey Alan 3 Bilge Pump 3
source share