General information
Forum:
Microsoft SQL Server
I have a table like this:
Sys Status
S1 1
S1 1
S1 1
S1 1
S1 2
S2 3
S1 0
S3 1
S2 1
S1 2
where
1 in the status means successful
2 means failed
3 means invalid
0 means pending
i would like to be able to count the status fields and group them like this:
system successful failed pending invalid
s1 4 2 1 0
s2 1 0 0 1
s3 1 0 0 0
note that the columns successful, failed, pending, and invalid, DO NOT contain the value of the status field but rather the count of the types of values in the field. would appreciate any help you could provide. thanks!
Next
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