Skip to content

Instantly share code, notes, and snippets.

View rcvaram's full-sized avatar
💭
Testing with localhost

Sivaram Rasathurai rcvaram

💭
Testing with localhost
View GitHub Profile
@chrisknoll
chrisknoll / Calculate Percentiles
Created June 17, 2015 05:00
Large scale percentile calculation in SQL
with rawData(count_value) as -- replace below query to get the values you would like to find percentiles of
(
select p.YEAR_OF_BIRTH
from dbo.PERSON p
),
overallStats (avg_value, stdev_value, min_value, max_value, total) as
(
select avg(1.0 * count_value) as avg_value,
stdev(count_value) as stdev_value,
min(count_value) as min_value,