2014-06-11 16 views

回答

9

大量查詢現在支持SPLIT():

SELECT word, nextword, COUNT(*) c 
FROM (
SELECT pos, title, word, LEAD(word) OVER(PARTITION BY created_utc,title ORDER BY pos) nextword FROM (
SELECT created_utc, title, word, pos FROM FLATTEN(
    (SELECT created_utc, title, word, POSITION(word) pos FROM 
    (SELECT created_utc, title, SPLIT(title, ' ') word FROM [bigquery-samples:reddit.full]) 
), word) 
)) 
WHERE nextword IS NOT null 
GROUP EACH BY 1, 2 
ORDER BY c DESC 
LIMIT 100 
+0

可愛!!哪裏可以找到一些文件? –

+0

很快在https://developers.google.com/bigquery/docs/query-reference中。我迫不及待地想分享這個消息:) –

相關問題