Skip to content
Advertisement

how can I can running status from my table?

I have a below table which has multiple rows with same executionid and different status. How can I get the row which status is running, rows will be exclude if executionid associated with both running and completed status?

Below image is the sample data :

enter image description here

Expected result should be: enter image description here

Advertisement

Answer

  • Using String_AGG() to get all the status per execution id into one list
  • Joining that list to the original data and then filtering out the results using NOT LIKE operator, if there are cases that are completed and running then they are not selected
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement