<p>I am trying to use Zend_Db_Select to write a select query that looks somewhat like this:</p>

<pre><code>SELECT * FROM bar WHERE a = 1 AND (b = 2 OR b = 3)
</code></pre>

<p>However, when using a combination of where() and orWhere(), it seems impossible to use condition grouping like the above.</p>

<p>Are there any native ways in Zend Framework to achieve the above (without writing the actual query?)</p>

From
the manual
(Example 11.61. Example of parenthesizing Boolean expressions)
```
```
// Build this query:
//   SELECT product_id, product_name, price
//   FROM "products"
//   WHERE (price < 100.00 OR price > 500.00)
//     AND (product_name = 'Apple')

$minimumPrice = 100;
$maximumPrice = 500;
$prod = 'Apple';

$select = $db->select()
             ->from('products',
                    array('product_id', 'product_name', 'price'))
             ->where("price < $minimumPrice OR price > $maximumPrice")
             ->where('product_name = ?', $prod);
```
```