Home > OS >  How to classify a set of rows in SQL?
How to classify a set of rows in SQL?

Time:11-15

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?

Try it out: enter image description here

enter image description here enter image description here

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?

  • Related