Big Query中是否有任何方法可以将CONTAINS与单词列表一起使用,而不是像下面那样一次使用一个单词:
选择 页面标题, IF(page_title CONTAINS (SELECT sourceName FROM SOURCETYPES),1,0) 来自访客
答案 0 :(得分:2)
如何使用等效的JOIN?
SELECT word
FROM [publicdata:samples.shakespeare] a
CROSS JOIN
(SELECT SPLIT(fragments) fragment FROM (SELECT "duck,cat,bear" fragments)) b
WHERE word CONTAINS fragment
GROUP BY 1
word
----
bear
scathful
bearing
dedication
mollification
...
替换"(SELECT SPLIT ...)"与所需的"(SELECT sourceName FROM SOURCETYPES)"。