I have a database table that contains user submitted answers to 3 questions. all the answers to the questions are yes/no answers. Like so
username question1 question2 question3
user1 yes no yes
user2 yes yes yes
user3 yes no no
user4 no no no
What I want to do is collect the count of each 'yes' in each column. So I would have the amount of yes's for each question ie 'question1' = '3', question2 = '1' etc etc.
At the moment I have 3 separate statements for each question which works fine but I was just wondering if there is a way to combine these into one statement to make it more effective?