Statistical Aggregate Functions
These standard statistical functions are provided by the sqlean "stats" extension which is built into SQL Notebook.
Syntax
MEDIAN(x)
PERCENTILE_25(x)
PERCENTILE_75(x)
PERCENTILE_90(x)
PERCENTILE_95(x)
PERCENTILE_99(x)
PERCENTILE(x, percentile) -- 0-100
STDDEV(x) -- Sample standard deviation
STDDEV_SAMP(x) -- Alias for STDDEV()
STDDEV_POP(x) -- Population standard deviation
VARIANCE(x) -- Sample variance
VAR_SAMP(x) -- Alias for VARIANCE()
VAR_POP(x) -- Population variance
Example
SELECT MEDIAN(value) FROM GENERATE_SERIES(100, 200); -- 150