I want to find sum of votes and am using codeigniter 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
SELECT sum(type) FROM `votes` WHERE questions_id=1
using codeigniter database class
Cheers