I feel as if this should be quite easy, but can\'t seem to find a solution. Suppose I have the following table:
|--------||---||---||---||---||---||---||---|
SELECT SUM( IF(q1 = 1, 1, 0) + IF(q2 = 1, 1, 0) + IF(q3 = 1, 1, 0) + IF(q4 = 1, 1, 0) + IF(q5 = 1, 1, 0) + IF(q6 = 1, 1, 0) + IF(q7 = 1, 1, 0) ) FROM table WHERE Company = 'abc'