mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-12 14:09:13 +00:00
1.4 KiB
1.4 KiB
ANSI SQL Aggregate Functions
https://www.oreilly.com/library/view/sql-in-a/9780596155322/ch04s02.html
Built in aggregates
COUNT(*)COUNT(expression)SUM(expression)AVG(expression)MIN(expression)MAX(expression)
https://sqlite.org/lang_aggfunc.html
Statistical aggregates
STDDEV_POP(expression)STDDEV_SAMP(expression)VAR_POP(expression)VAR_SAMP(expression)COVAR_POP(dependent, independent)COVAR_SAMP(dependent, independent)CORR(dependent, independent)
Linear regression aggregates
REGR_AVGX(dependent, independent)REGR_AVGY(dependent, independent)REGR_SXX(dependent, independent)REGR_SYY(dependent, independent)REGR_SXY(dependent, independent)REGR_COUNT(dependent, independent)REGR_SLOPE(dependent, independent)REGR_INTERCEPT(dependent, independent)REGR_R2(dependent, independent)
Set aggregates
CUME_DIST() OVER windowRANK() OVER windowDENSE_RANK() OVER windowPERCENT_RANK() OVER window
https://sqlite.org/windowfunctions.html#builtins
Boolean aggregates
EVERY(boolean)SOME(boolean)
Additional aggregates
MEDIAN(expression)PERCENTILE_CONT(expression, fraction)PERCENTILE_DISC(expression, fraction)