-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstats-aggregate-funcs.html
More file actions
47 lines (45 loc) · 2.04 KB
/
stats-aggregate-funcs.html
File metadata and controls
47 lines (45 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Statistical Aggregate Functions - SQL Notebook</title>
<link rel="stylesheet" href="sqlnotebook.css">
</head>
<body>
<header>
<table class="nav">
<tr>
<td>
<a href="index.html"><img src="art/SqlNotebookIcon.png" alt="SQL Notebook (logo)" style="width: 58px; height: 58px; float: left; margin-right: 20px;"></a>
</td>
<td>
<a href="index.html" id="title">SQL Notebook</a><br>
<nav>
<ul class="nav">
<li><a href="https://github.com/brianluft/sqlnotebook/releases">Download</a></li>
<li><a href="doc.html"><span id="header-doc-long">Documentation</span><span id="header-doc-short">Docs</span></a></li>
<li><a href="https://github.com/brianluft/sqlnotebook">GitHub</a></li>
</ul>
</nav>
</td>
</tr>
</table>
<hr style="margin-top: 15px; margin-bottom: 15px;">
</header>
<article><div id="article">
<h1>Statistical Aggregate Functions</h1>
<p>These standard statistical functions are provided by the <a moz-do-not-send="true" href=
"https://github.com/nalgeon/sqlean">sqlean "stats"</a> extension which is built into SQL Notebook.</p>
<h2>Syntax</h2>
<pre>MEDIAN(<i>x</i>)<br>PERCENTILE_25(<i>x</i>)<br>PERCENTILE_75(<i>x</i>)<br>PERCENTILE_90(<i>x</i>)<br>PERCENTILE_95(<i>x</i>)<br>PERCENTILE_99(<i>x</i>)<br>PERCENTILE(<i>x</i>, <i>percentile</i>) <i>-- 0-100</i><br>STDDEV(<i>x</i>) <i>-- Sample standard deviation</i><br>STDDEV_SAMP(<i>x</i>) <i>-- Alias for STDDEV()</i><br>STDDEV_POP(<i>x</i>) <i>-- Population standard deviation</i><br>VARIANCE(<i>x</i>) <i>-- Sample variance</i><br>VAR_SAMP(<i>x</i>) <i>-- Alias for VARIANCE()</i><br>VAR_POP(<i>x</i>) <i>-- Population variance</i><br></pre>
<h2>Example</h2>
<pre>SELECT MEDIAN(value) FROM GENERATE_SERIES(100, 200); <i>-- 150</i>
</pre>
</div></article>
<footer><div id="footer">
<hr>
© 2016-2025 <a href="https://github.com/electroly">Brian Luft</a>
</div></footer>
</body>
</html>