You can add "DISTINCT" with the distinct()
method. But is there any way to remove it after it is added?
Asked
Active
Viewed 144 times
2

Buttle Butkus
- 9,206
- 13
- 79
- 120
-
Which version of zend are you using? – Nandakumar V Jan 06 '15 at 05:12
-
@NandakumarV I'm not sure what version, but my `distinct()` method looks the same as what you posted. The file version is: `@version $Id: Select.php 23254 2010-10-26 12:49:23Z matthew $` – Buttle Butkus Jan 07 '15 at 00:59
1 Answers
4
The distinct
method accepts a parameter $flag(bool)
. Setting it to false
will disable the distinct from the query. Check
Zend/Db/Select.php Line 192
/**
* Makes the query SELECT DISTINCT.
*
* @param bool $flag Whether or not the SELECT is DISTINCT (default true).
* @return Zend_Db_Select This Zend_Db_Select object.
*/
public function distinct($flag = true)
{
$this->_parts[self::DISTINCT] = (bool) $flag;
return $this;
}
NB This is for Zend 1.12

Nandakumar V
- 4,317
- 4
- 27
- 47
-
@ButtleButkus You can find the version using this `echo Zend_Version::VERSION;` – Nandakumar V Jan 07 '15 at 04:38