Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-12-11 : 07:56:06
|
Fernando writes "Hi,for some reason (stupidity maybe) I can't solve this problem...I have a table with this information:ID | SerialNumber | Result1 | 123 | Pass2 | 125 | Fail3 | 234 | PassI just want a select that shows how many pass and fail...Like this:Pass | Fail2 | 1Symple! I guess :(" |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-12-11 : 07:59:31
|
select sum(case when result = 'pass' then 1 else 0 end) AS [Pass],sum(case when result = 'fail' then 1 else 0 end) AS [Fail]from yourtablenameherePeter LarssonHelsingborg, Sweden |
 |
|
|
|
|