LIKE 条件下的多个字符串 - Presto SQL
Multiple strings in LIKE condition - Presto SQL
我想使用 LIKE
条件查询 table 中的列,这很好用-
select * from my_table where my_column LIKE '%hello%';
但是,如何在 LIKE
条件下使用多个字符串查询此列?寻找像-
这样的东西
select * from my_table where my_column LIKE ['%hello%'|'example%'|'%random%'|'%demo'];
使用regexp_like()
:
select *
from my_table
where regexp_like(my_column, 'hello|example|random|demo');
我想使用 LIKE
条件查询 table 中的列,这很好用-
select * from my_table where my_column LIKE '%hello%';
但是,如何在 LIKE
条件下使用多个字符串查询此列?寻找像-
select * from my_table where my_column LIKE ['%hello%'|'example%'|'%random%'|'%demo'];
使用regexp_like()
:
select *
from my_table
where regexp_like(my_column, 'hello|example|random|demo');