Reputation: 1039
I would like to write something equivalent to the below, but it appears not to work. Is this possible in BigQuery?
select *
from table
where lower(field1) in ("%foo%", "%bar%", "%baz%")
I also need this functionality inside a case when
clause
case when (lower(field1) in ("%foo%", "%bar%")) then "string1"
else "string2" end as NewField
Upvotes: 1
Views: 2336
Reputation: 172984
Use below approach
select *
from table
where regexp_contains(lower(field1), r'foo|bar|baz')
Upvotes: 3