Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
select
processid,
name,
sum(case when status = 'Created' then 1 else 0 end) as Created,
sum(case when status = 'Ready' then 1 else 0 end) as Ready,
sum(case when status = 'Reserved' then 1 else 0 end) as Reserved,
sum(case when status = 'InProgress' then 1 else 0 end) as InProgress,
sum(case when status = 'Completed' then 1 else 0 end) as Completed,
sum(case when status = 'Failed' then 1 else 0 end) as Failed,
sum(case when status = 'Error' then 1 else 0 end) as Error,
sum(case when status = 'Exited' then 1 else 0 end) as Exited,
sum(case when status = 'Obsolete' then 1 else 0 end) as Obsolete
from
AuditTaskImpl
group by
processid,
name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment