这是我在这里的第一篇文章,所以我会尽量保持它简单易读。加入like bigquery
在Postgres
我可以查找一个字符串包含另一个字符串的次数,在我的例子中,我有一个列表的情绪,我试图寻找他们在论坛帖子标题中提到了多少次坐在另一张桌子上。在Postgres
我通常使用LEFT Join ON
字符串从table1 LIKE string from table2
这样做。当我试图在Bigquery
中这样做时,它不起作用,我尝试使用LIKE
,CONTAINS
和REGEXP_MATCH
。这些将是我想要做的查询类型。
SELECT sentiment_type, count(*) FROM
((SELECT forum, page_link, post_title, user, posted_date, content
FROM [sandbox:Forum_data.forum_table]) t1
JOIN [sandbox:Taxonomies.sentiment_taxonomy] t2
ON lower(post_title) LIKE '%'||lower(sentiment)||'%') a
GROUP BY sentiment_type, sentiment
ORDER BY 3 desc
你知道这是否可能在Bigquery
?
谢谢。
您需要使用#StandardSql加入上的不平等https://cloud.google.com/bigquery/sql-reference/enabling-standard- SQL – Pentium10