Perhaps try one of these:
->delete('table', new Zend_Db_Expr('col1 IN ("1","2")'));
OR
->delete('table', new Zend_Db_Expr('col1 IN ( SELECT col2 FROM table2 WHERE
col3="someValue")');
The prevalent idea here is to use Zend_Db_Expr instead of a plain string:
http://framework.zend.com/manual/en/zend.db.html (search for Zend_Db_Expr)
If you pass in an array of id's they will be ANDed together to form your
where part.
-ralph
On 12/29/08 8:26 AM, "S. Alexandre Lemaire" <[email protected]> wrote:
> Hello Folks,
>
> Is there a provision in the ->delete( 'table', ... ) to handle IN
> clauses or subqueries?
>
> eg:
>
> 1. DELETE FROM table1 WHERE col1 IN ( '1', '2' )
>
> 2. DELETE FROM table1 WHERE col1 IN ( SELECT col2 FROM table2 WHERE
> col3=? )
>
>
> Or is it only capable of handling basic equalities?
>
> Thanks.
> Alex
>
>
--
Ralph Schindler
Software Engineer | [email protected]
Zend Framework | http://framework.zend.com/