title: Changing table name in Zend_db_select
body: <pre><code>SELECT SUM(Table.ColumnThatChanges) AS 'Count', Table.B as 'Param'
  FROM Table
  WHERE Table.C = 4
      AND Table.B = 'Something'
      AND Table.Date BETWEEN '2014-01-01 00:00:00' AND '2014-06-30 00:00:00'
  </code></pre>
  
  <p>I have this SQL Query that I generate in php. I want to call this query quite a few times with a slight change; I am changing ColumnThatChanges every request.</p>
  
  <p>What would be the better/fastest way to do this? Use str_replace? Call the entire string everytime? Use some type of class that generates my SQL statement?</p>
  
  <p>I'm currently generating it this way with Zend:</p>
  
  <pre><code>$somequery = $this-&gt;db-&gt;select();
  $somequery-&gt;from(Table, array('SUM(Table.ColumnThatChanges) AS Count', 'Table.B as Param'))
  -&gt;where('C = ?', $Variable)
  -&gt;where('B = ?', $Variable2)
  -&gt;where('Date &gt; ?', $start_date)
  -&gt;where('Date &lt; ?', $end_date);
  </code></pre>
  
  <p>I haven't had much success changing the ColumnThatChanges part of the query, maybe I'm doing it wrong?</p>