I have a column which is a string of comma seperated elements like this statuses= 'Initial,Initial,Completed,InProgress. And I what to make a status column like this:
CASE
WHEN <all statuses are 'Initial'> THEN 'Initial'
WHEN <all statuses are 'Completed'> THEN 'Completed'
ELSE 'InProgress'
END AS status
I have tried bool_and(string_to_array(statuses,',')='Initial'), which does not compile. Any suguestions?