Skip to content

Instantly share code, notes, and snippets.

@jesuino
Last active January 15, 2021 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesuino/c6fe59e5c87095243d05a2fe33de5f76 to your computer and use it in GitHub Desktop.
Save jesuino/c6fe59e5c87095243d05a2fe33de5f76 to your computer and use it in GitHub Desktop.
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