How do I get a count of how many columns are (or aren't) null in a query?
Basically I have a survey with 30 questions that creates a record in a database. Sometimes people forget they only answered 25% of the survey questions.
How do I get a count of how many columns where left 'null' in a query?
Since you're wanting the count on the model of unanswered questions, you could just create an accessor on the model which returns the filtered count. Then you could easily just show them how many questions, or percentage of questions, they haven't answered yet (like a progress bar).