select sum(case when '%sys%' like any(series_arr)
or 'displays' = any(lob_arr)
then revenue else 0 end) as sys_displ_revenue
from mytable
Basically, when I run this query, the term '%sys%' like any(<array column>) seems to get ignored, and only the 'displays' revenue is used.
How to solve this?
unnest()and uselikewith each element.sum(case)conditional aggregate construct can be replaced with afilterclause.Demo at db<>fiddle: