title: How do I use a "HAVING" clause in a Zend_Db_Select statement without parenthesis?
body: <p>I know Zend provides a having() method, but what I want is a query like:</p>
  
  <pre><code>SELECT a.*, `as`.* FROM `fruit_db`.`apples` AS `a`
  INNER JOIN `fruit_db`.`apple_seeds` AS `as` ON a.id = as.apple_id
  WHERE (a.id = 1) AND as.seed_name HAVING 'johnny'
  </code></pre>
  
  <p>not "HAVING (as.seed_name = 'johnny')"</p>
  
  <p>Backtracking a bit, we have the tables:</p>
  
  <p>fruit_db.apples</p>
  
  <pre><code>| id  | name |
  --------------
  |  1  | red  |
  |  2  | green|
  </code></pre>
  
  <p>fruit_db.apple_seeds</p>
  
  <pre><code>| apple_id | seed_name | 
  ------------------------
  | 1        | johnny    |
  | 1        | judy      |
  | 2        | granny    |
  </code></pre>
  
  <p>I want the results like:</p>
  
  <pre><code>| id  | name | apple_id | seed_name |
  -------------------------------------
  | 1   | red  |    1     | johnny    |
  | 1   | red  |    1     | judy      |
  </code></pre>
  
  <p>The above query provided gives this result, but using Zend_Db_Select puts parenthesis around each portion of the having and where statements which invalidates my query. So</p>
  
  <pre><code>$zend_db_table-&gt;select()
   -&gt;setIntegrityCheck(false)
   -&gt;from(array("a" =&gt; "apples"), array("*"))
   -&gt;join(array("as"=&gt;"apple_seeds"),
       "a.id = as.apple_id",
     array("*"))
   -&gt;where('a.id = 1')
   -&gt;where('as.seed_name HAVING "johnny"');
  </code></pre>
  
  <p>produces:</p>
  
  <pre><code>SELECT a.*, `as`.* FROM `fruit_db`.`apples` AS `a`
  INNER JOIN `fruit_db`.`apple_seeds` AS `as` ON a.id = as.apple_id
  WHERE (a.id = 1) AND (as.seed_name HAVING 'johnny')
  </code></pre>
  
  <p>Which is invalid SQL. In short:</p>
  
  <pre><code>SELECT a.*, `as`.* FROM `fruit_db`.`apples` AS `a`
  INNER JOIN `fruit_db`.`apple_seeds` AS `as` ON a.id = as.apple_id
  WHERE (a.id = 1) AND as.seed_name HAVING 'johnny'
  </code></pre>
  
  <p>is valid, but:</p>
  
  <pre><code>SELECT a.*, `as`.* FROM `fruit_db`.`apples` AS `a`
  INNER JOIN `fruit_db`.`apple_seeds` AS `as` ON a.id = as.apple_id
  WHERE (a.id = 1) AND (as.seed_name HAVING 'johnny')
  </code></pre>
  
  <p>which Zend produces is invalid SQL. I don't want just the one row that has seen_name 'johnny', i want ALL rows where apple id = 1 AND seed_name 'johnny' is somewhere in those results. Can I get what I need via Zend_Db_Select or do I need to go the raw query() route?</p>
  
  <p>Edit: I've revised the question a bit to be closer to what I want and trying to clarify it a bit. </p>