I have a table with five tinyint columns.
If I make a query searching for a row, I get a result like this:
select flag1, flag2, flag3, flag4, flag5 from mytable where whatever;
What I need is to get the sum as if they were integers. In this example, the output are four ones and one zero, so I'd like to get a 4.
This query does not work:
select sum(flag1, flag2, flag3, flag4, flag5) from mytable where whatever;
This doesn't either:
select sum(flag1, flag2, flag3, flag4, flag5) from mytable where whatever;