Zend-db sql query distinct

does anyone know how to use DISTINCT in our query usin zend-db sql???
the example here is shown:

$sql = new Sql($this->db);
$select = $sql->select('keywords_relation')
    ->join(['k'=>'keywords'],'k.id = keywords_relation.kid',['keyword','counter'])
    ->join(['p'=>'posts'],'p.cid = keywords_relation.cid')
    ->where(['keywords_relation.cid'=>$cid])
->order('k.counter DESC');

with the provided code i get multiple results with the same value from keywords table.
I just want to get different values.
thanks.

could you provide the raw sql first you want to build wiht select object?

$select->quantifier(Select::QUANTIFIER_DISTINCT)
2 Likes