[英]How to remove a specific condition on the where clause (zend framework)?
I have the following query generated by the default library of a third party framework 我有以下查询由第三方框架的默认库生成
SELECT COUNT(*) AS "total_rows" FROM "papers" WHERE (papers.paper_trash=0 OR papers.paper_trash IS NULL) AND (paper_category_id='7') AND (qtdavaliacoes='0')
I know that if I use a $query->reset(Zend_Db_Select::WHERE);
我知道如果我使用
$query->reset(Zend_Db_Select::WHERE);
it will clear the where clause completely, is it possible to clear only the AND (qtdavaliacoes='0')
condition from it using zend? 它将完全清除where子句,是否可以使用zend从其中仅清除
AND (qtdavaliacoes='0')
条件?
As per the documentation , it is not possible to reset only part of the WHERE
condition. 根据文档 ,不可能仅重设
WHERE
条件的一部分。 You would need to either: 您将需要:
WHERE
condition and add the ones needed ; WHERE
条件并添加需要的条件;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.