In Doctrine I can do:
public function getCount()
{
$q = $this->createQuery('q')
->select('*')
->addSelect('count(q.name) as count')
->groupBy('q.name')
->orderBy('count DESC');
return $q->execute();
}
How can I do the same in Propel in Symfony 1.4?
SELECT name, COUNT(*) FROM x GROUP BY name
(theSELECT *
in the question may be a red herring) – Metacarpus