SQL to get counts by statuses and completeness
Recently I came across a need to get the counts of result by statuses as well as completeness – i.e. getting positive result (pass) in all cases.
I quickly wrote a query to get a count by each status. Not only it provides by each status – pass and fail but also look results for completeness – i.e. all pass were partial pass or missing result value (null).
Thought will share with everyone, if you need to get counts not just by statuses but also completeness of data.
Here is SQL Fiddle
get counts by statuses and completeness