Created
February 22, 2017 09:47
-
-
Save savelee/3baf4d3dced1cdf0dbc3fcbff3494c78 to your computer and use it in GitHub Desktop.
BigQuery String Regex example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#standardSQL | |
SELECT | |
word, | |
COUNT(word) AS count | |
FROM | |
`publicdata.samples.shakespeare` | |
WHERE | |
(REGEXP_CONTAINS(word, | |
r'^\w\w\'\w\w')) | |
GROUP BY | |
word | |
ORDER BY | |
count DESC | |
LIMIT | |
3; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment