Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I need help...
Message
 
 
À
23/01/2001 22:10:53
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
00466473
Message ID:
00467779
Vues:
10
Hi!

I'm glad you solved your problem.
I just forget that SUM was required instead of count() in your case. Anyway, you approach might be even more efficient...

>I got it! I modified your statement to this:
>
>Select Sys, COUNT(CASE Status WHEN Status=1 THEN 1 END) as successful,
>COUNT(CASE Status WHEN 2 THEN 1 END) as failed,
>COUNT(CASE Status WHEN 3 THEN 1 END) as invalid,
>COUNT(CASE Status WHEN 0 THEN 1 END) as pending
>FROM MyTable GROUP BY Sys
>
>Again, thank you very much!
>
>
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform