title: active record summation in codeigniter
body: <p>I want to find sum of votes and am using <a href="http://codeigniter.com/" rel="nofollow">codeigniter</a> and mysql. In my votes table i've a column which shows type of vote 0 for down vote and 1 for up vote how can i generate an sql that looks like this</p>
  
  <pre><code>SELECT sum(type) FROM `votes` WHERE questions_id=1
  </code></pre>
  
  <p>using codeigniter database class</p>
  
  <p>Cheers</p>