How to use distinct in Zend Framework 2?

Emmanuel Gauthier picture Emmanuel Gauthier · Mar 11, 2013 · Viewed 13.4k times · Source

How can I use the distinct clause with Zend\Db\Sql\?

Answer

Mihai picture Mihai · Jun 24, 2013

I found this very usefull solution on http://blog.abmeier.de/php/zf2-select-distinct

$sql = new Sql($adapter);
$select = $sql->select();
$select->quantifier('DISTINCT');