【发布时间】:2021-08-30 11:43:28
【问题描述】:
我想返回产品描述中包含的所有屏蔽列表字词
with blocklist as (
select 'instagram' as blocklist union all
select 'facebook' as blocklist union all
select 'whatsapp web'
),
products as (
select 'seller1' as seller, 'Tenis Nike 43 call me on instagram or facebook' as product union all
select 'seller1' as seller, 'TV 42 sansung link whatsapp WEB or INSTAGRAM' as product union all
select 'seller2' as seller, 'TV 42 sansung link' as product
)
select
seller
,product
,blocklists
from
?
结果会是这样的
| seller | product | blocklists |
|---|---|---|
| seller 1 | Tenis Nike 43 call me on instagram or facebook | instagram,facebook |
| seller 1 | TV 42 sansung link whatsapp WEB | whatsapp web,instagram |
| seller 2 | TV 42 sansung link | null |
我是否需要将阻止列表转换为数组,在 select ... 上使用正则表达式?
【问题讨论】:
标签: arrays regex select google-bigquery match