I have the following table and would like to get the result as count
Users QuestionType Question Answer
User 1 Employment Question 1 Yes
Question2 NULL
User 1 Job History Question 3 Yes
Question 4 Yes
Question 5 No
User 1 Work Status Question 6 null
Question 7 null
User 2 Job History Question 3 Yes
Question 4 Yes
Question 5 No
User 2 Work Status Question 6 yes
Question 7 yes
Result
Count of Users
Employment 1
Job History 2
Work Status 1
How do I get a single count for multiple rows from within mysql?
Petbe1and not2, orWildbe3? If that's what you want, just useCOUNT(Animal) as Count GROUP BY TYPEin your query.Otherscome from ? Haven't you tried anything to get those results ?count? It's just a constant 1.