December 7, 2006 at 6:23 pm
Hi all,
for some reason (stupidity maybe) I can't solve this problem...
I have a table with this information:
ID SerialNumber Result
1 123 Pass
2 125 Fail
3 234 Pass
I just want a select that shows how many pass and fail...
Like this:
Pass | Fail
2 | 1
Thank you
December 7, 2006 at 6:27 pm
SELECT COUNT(case Result when 'Pass' then 1 else NULL end) as Pass,
COUNT(case Result when 'Fail' then 1 else NULL end) as Fail
FROM ...
_____________
Code for TallyGenerator
December 8, 2006 at 11:11 am
I personally would add a third column and change the script so that NULLs showed up as Unknown.
Then if you have Unknowns, you can go back and further investigate them. Or you might have entries where the course/test/whatever isn't finished.
-SQLBill
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply