Skip to content

Instantly share code, notes, and snippets.

@AdenForshaw
Created February 4, 2021 21:52
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 AdenForshaw/9b89d252af43dc66ae30609c5d3f9955 to your computer and use it in GitHub Desktop.
Save AdenForshaw/9b89d252af43dc66ae30609c5d3f9955 to your computer and use it in GitHub Desktop.
[Percentiles in BigQuery]
select
percentiles[offset(10)] as p10,
percentiles[offset(25)] as p25,
percentiles[offset(50)] as p50,
percentiles[offset(75)] as p75,
percentiles[offset(90)] as p90,
from (
select approx_quantiles(char_length(text), 100) percentiles
from `bigquery-public-data.hacker_news.full`
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment