ARAVINDH GOPI - 4 months ago 36

MySQL Question

Answer

Sorry for the inconvienience, my question is "how to count field values of multiple rows". I got my answer below

```
select (sum(case when m1 = 6 then 1 else 0 end) +
sum(case when m2 = 6 then 1 else 0 end) +
sum(case when m3 = 6 then 1 else 0 end) +
sum(case when m4 = 6 then 1 else 0 end) +
sum(case when m5 = 6 then 1 else 0 end)) as abc from table where staff_name='sivakumar';
```