Using CakePHP 1.2, I am trying produce a GROUP BY
query:
SELECT `categories`.*, COUNT(`entities`.id)
FROM `categories`
LEFT JOIN `entities` ON (`categories`.`id` = `entities`.`category_id`)
GROUP BY `categories`.`id`
How would/should I go about doing this? I am using 'Containable' if that helps.
This is what I eneded up with:
Possible keys by default, all of which are optional:
Query:
Model->find() has a
group
param.