I am trying to solve this SQL exercise. But I do not have any idea how to do it. Do someone have a good idea?
CodePudding user response:
Something like:
SELECT workflow
, case when min(status) = max(status) THEN min(status) -- if all status is same, set to status
when min(case when status = 'Error' then 0 end) = 0 then 'Intederminate' -- if any status is error then intedermined
else 'Running' end
FROM #ProcessLog
group by workflow
mayhaps?