Skip to content

Instantly share code, notes, and snippets.

@savelee
Created February 22, 2017 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save savelee/3baf4d3dced1cdf0dbc3fcbff3494c78 to your computer and use it in GitHub Desktop.
Save savelee/3baf4d3dced1cdf0dbc3fcbff3494c78 to your computer and use it in GitHub Desktop.
BigQuery String Regex example
#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