Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I need help...
Message
From
24/01/2001 04:38:05
 
 
To
23/01/2001 22:10:53
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00466473
Message ID:
00467779
Views:
11
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform