General information
Forum:
Microsoft SQL Server
You're a miracle-worker! Thank you very, very much!
>Hi!
>
>Try following:
>
>Select Sys, COUNT(CASE WHEN Status=1 THEN 1 ELSE 0 END) as successful,
>COUNT(CASE WHEN Status=2 THEN 1 ELSE 0 END) as failed,
>COUNT(CASE WHEN Status=3 THEN 1 ELSE 0 END) as invalid,
>COUNT(CASE WHEN Status=0 THEN 1 ELSE 0 END) as pending
>FROM MyTable GROUP BY Sys
>
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only