| 1 |
<!DOCTYPE html> |
| 2 |
<html><head> |
| 3 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 4 |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
| 5 |
<link href="../sqlite.css" rel="stylesheet"> |
| 6 |
<title>SQLite Syntax: aggregate-function-invocation</title> |
| 7 |
<!-- path=../ --> |
| 8 |
</head> |
| 9 |
<body> |
| 10 |
<div class=nosearch> |
| 11 |
<a href="../index.html"> |
| 12 |
<img class="logo" src="../images/sqlite370_banner.svg" alt="SQLite" border="0"> |
| 13 |
</a> |
| 14 |
<div><!-- IE hack to prevent disappearing logo --></div> |
| 15 |
<div class="tagline desktoponly"> |
| 16 |
Small. Fast. Reliable.<br>Choose any three. |
| 17 |
</div> |
| 18 |
<div class="menu mainmenu"> |
| 19 |
<ul> |
| 20 |
<li><a href="../index.html">Home</a> |
| 21 |
<li class='mobileonly'><a href="javascript:void(0)" onclick='toggle_div("submenu")'>Menu</a> |
| 22 |
<li class='wideonly'><a href='../about.html'>About</a> |
| 23 |
<li class='desktoponly'><a href="../docs.html">Documentation</a> |
| 24 |
<li class='desktoponly'><a href="../download.html">Download</a> |
| 25 |
<li class='wideonly'><a href='../copyright.html'>License</a> |
| 26 |
<li class='desktoponly'><a href="../support.html">Support</a> |
| 27 |
<li class='desktoponly'><a href="../prosupport.html">Purchase</a> |
| 28 |
<li class='search' id='search_menubutton'> |
| 29 |
<a href="javascript:void(0)" onclick='toggle_search()'>Search</a> |
| 30 |
</ul> |
| 31 |
</div> |
| 32 |
<div class="menu submenu" id="submenu"> |
| 33 |
<ul> |
| 34 |
<li><a href='../about.html'>About</a> |
| 35 |
<li><a href='../docs.html'>Documentation</a> |
| 36 |
<li><a href='../download.html'>Download</a> |
| 37 |
<li><a href='../support.html'>Support</a> |
| 38 |
<li><a href='../prosupport.html'>Purchase</a> |
| 39 |
</ul> |
| 40 |
</div> |
| 41 |
<div class="searchmenu" id="searchmenu"> |
| 42 |
<form method="GET" action="../search"> |
| 43 |
<select name="s" id="searchtype"> |
| 44 |
<option value="d">Search Documentation</option> |
| 45 |
<option value="c">Search Changelog</option> |
| 46 |
</select> |
| 47 |
<input type="text" name="q" id="searchbox" value=""> |
| 48 |
<input type="submit" value="Go"> |
| 49 |
</form> |
| 50 |
</div> |
| 51 |
</div> |
| 52 |
<script> |
| 53 |
function toggle_div(nm) { |
| 54 |
var w = document.getElementById(nm); |
| 55 |
if( w.style.display=="block" ){ |
| 56 |
w.style.display = "none"; |
| 57 |
}else{ |
| 58 |
w.style.display = "block"; |
| 59 |
} |
| 60 |
} |
| 61 |
function toggle_search() { |
| 62 |
var w = document.getElementById("searchmenu"); |
| 63 |
if( w.style.display=="block" ){ |
| 64 |
w.style.display = "none"; |
| 65 |
} else { |
| 66 |
w.style.display = "block"; |
| 67 |
setTimeout(function(){ |
| 68 |
document.getElementById("searchbox").focus() |
| 69 |
}, 30); |
| 70 |
} |
| 71 |
} |
| 72 |
function div_off(nm){document.getElementById(nm).style.display="none";} |
| 73 |
window.onbeforeunload = function(e){div_off("submenu");} |
| 74 |
/* Disable the Search feature if we are not operating from CGI, since */ |
| 75 |
/* Search is accomplished using CGI and will not work without it. */ |
| 76 |
if( !location.origin || !location.origin.match || !location.origin.match(/http/) ){ |
| 77 |
document.getElementById("search_menubutton").style.display = "none"; |
| 78 |
} |
| 79 |
/* Used by the Hide/Show button beside syntax diagrams, to toggle the */ |
| 80 |
function hideorshow(btn,obj){ |
| 81 |
var x = document.getElementById(obj); |
| 82 |
var b = document.getElementById(btn); |
| 83 |
if( x.style.display!='none' ){ |
| 84 |
x.style.display = 'none'; |
| 85 |
b.innerHTML='show'; |
| 86 |
}else{ |
| 87 |
x.style.display = ''; |
| 88 |
b.innerHTML='hide'; |
| 89 |
} |
| 90 |
return false; |
| 91 |
} |
| 92 |
var antiRobot = 0; |
| 93 |
function antiRobotGo(){ |
| 94 |
if( antiRobot!=3 ) return; |
| 95 |
antiRobot = 7; |
| 96 |
var j = document.getElementById("mtimelink"); |
| 97 |
if(j && j.hasAttribute("data-href")) j.href=j.getAttribute("data-href"); |
| 98 |
} |
| 99 |
function antiRobotDefense(){ |
| 100 |
document.body.onmousedown=function(){ |
| 101 |
antiRobot |= 2; |
| 102 |
antiRobotGo(); |
| 103 |
document.body.onmousedown=null; |
| 104 |
} |
| 105 |
document.body.onmousemove=function(){ |
| 106 |
antiRobot |= 2; |
| 107 |
antiRobotGo(); |
| 108 |
document.body.onmousemove=null; |
| 109 |
} |
| 110 |
setTimeout(function(){ |
| 111 |
antiRobot |= 1; |
| 112 |
antiRobotGo(); |
| 113 |
}, 100) |
| 114 |
antiRobotGo(); |
| 115 |
} |
| 116 |
antiRobotDefense(); |
| 117 |
</script> |
| 118 |
<h1 align='center'>aggregate-function-invocation</h1> |
| 119 |
<div class='imgcontainer'> |
| 120 |
<div style="max-width:909px"><svg xmlns='http://www.w3.org/2000/svg' style='font-size:initial;' class="pikchr" viewBox="0 0 909.533 223.344" data-pikchr-date="20250319161943"> |
| 121 |
<circle cx="5.76" cy="56.592" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 122 |
<polygon points="32.4,56.592 20.88,60.912 20.88,52.272" style="fill:rgb(0,0,0)"/> |
| 123 |
<path d="M9.36,56.592L26.64,56.592" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 124 |
<path d="M47.52,71.712L156.557,71.712A15.12 15.12 0 0 0 171.677 56.592A15.12 15.12 0 0 0 156.557 41.472L47.52,41.472A15.12 15.12 0 0 0 32.4 56.592A15.12 15.12 0 0 0 47.52 71.712Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 125 |
<text x="102.038" y="56.592" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">aggregate-func</text> |
| 126 |
<polygon points="189.677,56.592 178.157,60.912 178.157,52.272" style="fill:rgb(0,0,0)"/> |
| 127 |
<path d="M171.677,56.592L183.917,56.592" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 128 |
<path d="M204.797,71.712A15.12 15.12 0 0 0 219.917 56.592A15.12 15.12 0 0 0 204.797 41.472A15.12 15.12 0 0 0 189.677 56.592A15.12 15.12 0 0 0 204.797 71.712Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 129 |
<text x="204.797" y="56.592" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">(</text> |
| 130 |
<polygon points="242.957,56.592 231.437,60.912 231.437,52.272" style="fill:rgb(0,0,0)"/> |
| 131 |
<path d="M219.917,56.592L237.197,56.592" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 132 |
<polygon points="277.517,26.352 265.997,30.672 265.997,22.032" style="fill:rgb(0,0,0)"/> |
| 133 |
<path d="M242.957,56.592 L 248.717,56.592 Q 254.477,56.592 254.477,41.592 L 254.477,41.352 Q 254.477,26.352 263.117,26.352 L 271.757,26.352" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 134 |
<path d="M292.637,41.472L360.893,41.472A15.12 15.12 0 0 0 376.013 26.352L376.013,26.352A15.12 15.12 0 0 0 360.893 11.232L292.637,11.232A15.12 15.12 0 0 0 277.517 26.352L277.517,26.352A15.12 15.12 0 0 0 292.637 41.472Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 135 |
<text x="326.765" y="26.352" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">DISTINCT</text> |
| 136 |
<polygon points="394.013,26.352 382.493,30.672 382.493,22.032" style="fill:rgb(0,0,0)"/> |
| 137 |
<path d="M376.013,26.352L388.253,26.352" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 138 |
<polygon points="428.573,56.592 417.053,60.912 417.053,52.272" style="fill:rgb(0,0,0)"/> |
| 139 |
<path d="M394.013,26.352 L 399.773,26.352 Q 405.533,26.352 405.533,41.352 L 405.533,41.592 Q 405.533,56.592 414.173,56.592 L 422.813,56.592" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 140 |
<polygon points="464.573,56.592 453.053,60.912 453.053,52.272" style="fill:rgb(0,0,0)"/> |
| 141 |
<path d="M428.573,56.592L458.813,56.592" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 142 |
<path d="M464.573,71.712L513.763,71.712L513.763,41.472L464.573,41.472Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 143 |
<text x="489.168" y="56.592" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">expr</text> |
| 144 |
<polygon points="657.763,56.592 646.243,60.912 646.243,52.272" style="fill:rgb(0,0,0)"/> |
| 145 |
<path d="M513.763,56.592L652.003,56.592" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 146 |
<path d="M672.883,71.712A15.12 15.12 0 0 0 688.003 56.592A15.12 15.12 0 0 0 672.883 41.472A15.12 15.12 0 0 0 657.763 56.592A15.12 15.12 0 0 0 672.883 71.712Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 147 |
<text x="672.883" y="56.592" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">)</text> |
| 148 |
<polygon points="734.083,86.832 722.563,91.152 722.563,82.512" style="fill:rgb(0,0,0)"/> |
| 149 |
<path d="M688.003,56.592 L 699.523,56.592 Q 711.043,56.592 711.043,71.592 L 711.043,71.832 Q 711.043,86.832 719.683,86.832 L 728.323,86.832" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 150 |
<path d="M734.083,101.952L846.173,101.952L846.173,71.712L734.083,71.712Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 151 |
<text x="790.128" y="86.832" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">filter-clause</text> |
| 152 |
<polygon points="900.173,56.592 888.653,60.912 888.653,52.272" style="fill:rgb(0,0,0)"/> |
| 153 |
<path d="M846.173,86.832 L 855.173,86.832 Q 864.173,86.832 864.173,71.832 L 864.173,71.592 Q 864.173,56.592 879.173,56.592 L 879.413,56.592 L 894.413,56.592" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 154 |
<circle cx="903.773" cy="56.592" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 155 |
<polygon points="790.128,56.592 778.608,60.912 778.608,52.272" style="fill:rgb(0,0,0)"/> |
| 156 |
<path d="M688.003,56.592L784.368,56.592" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 157 |
<polygon points="900.173,56.592 888.653,60.912 888.653,52.272" style="fill:rgb(0,0,0)"/> |
| 158 |
<path d="M790.128,56.592L894.413,56.592" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 159 |
<polygon points="326.765,56.592 315.245,60.912 315.245,52.272" style="fill:rgb(0,0,0)"/> |
| 160 |
<path d="M242.957,56.592L321.005,56.592" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 161 |
<polygon points="428.573,56.592 417.053,60.912 417.053,52.272" style="fill:rgb(0,0,0)"/> |
| 162 |
<path d="M326.765,56.592L422.813,56.592" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 163 |
<path d="M489.168,32.4A15.12 15.12 0 0 0 504.288 17.28A15.12 15.12 0 0 0 489.168 2.16A15.12 15.12 0 0 0 474.048 17.28A15.12 15.12 0 0 0 489.168 32.4Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 164 |
<text x="489.168" y="17.28" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">,</text> |
| 165 |
<polygon points="504.288,17.28 515.808,12.96 515.808,21.6" style="fill:rgb(0,0,0)"/> |
| 166 |
<path d="M513.763,56.592 L 525.283,56.592 Q 536.803,56.592 536.803,41.592 L 536.803,32.28 Q 536.803,17.28 523.426,17.28 L 510.048,17.28" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 167 |
<polygon points="464.573,56.592 453.053,60.912 453.053,52.272" style="fill:rgb(0,0,0)"/> |
| 168 |
<path d="M474.048,17.28 L 456.533,17.28 Q 441.533,17.28 441.533,32.28 L 441.533,41.592 Q 441.533,56.592 450.173,56.592 L 458.813,56.592" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 169 |
<path d="M438.84,207.792A15.12 15.12 0 0 0 453.96 192.672A15.12 15.12 0 0 0 438.84 177.552A15.12 15.12 0 0 0 423.72 192.672A15.12 15.12 0 0 0 438.84 207.792Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 170 |
<text x="438.84" y="192.672" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">*</text> |
| 171 |
<polygon points="423.72,192.672 412.2,196.992 412.2,188.352" style="fill:rgb(0,0,0)"/> |
| 172 |
<path d="M242.957,56.592 L 248.717,56.592 Q 254.477,56.592 254.477,71.592 L 254.477,177.672 Q 254.477,192.672 269.477,192.672 L 402.96,192.672 L 417.96,192.672" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 173 |
<polygon points="489.168,192.672 477.648,196.992 477.648,188.352" style="fill:rgb(0,0,0)"/> |
| 174 |
<path d="M453.96,192.672L483.408,192.672" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 175 |
<path d="M489.168,192.672 L 570.763,192.672 Q 585.763,192.672 600.763,192.672 L 605.323,192.672 Q 620.323,192.672 620.323,177.672 L 620.323,71.592 Q 620.323,56.592 626.083,56.592 L 631.843,56.592" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 176 |
<polygon points="438.84,216.864 427.32,221.184 427.32,212.544" style="fill:rgb(0,0,0)"/> |
| 177 |
<path d="M326.765,192.672 L 392.405,192.672 Q 407.405,192.672 407.405,204.768 Q 407.405,216.864 420.242,216.864 L 433.08,216.864" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 178 |
<path d="M438.84,216.864 L 453.24,216.864 Q 467.64,216.864 467.64,204.768 Q 467.64,192.672 473.4,192.672 L 479.16,192.672" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 179 |
<polygon points="300.557,117.072 289.037,121.392 289.037,112.752" style="fill:rgb(0,0,0)"/> |
| 180 |
<path d="M513.763,56.592 L 523.843,56.592 Q 533.923,56.592 533.923,71.592 L 533.923,71.832 Q 533.923,86.832 518.923,86.832 L 292.517,86.832 Q 277.517,86.832 277.517,101.832 L 277.517,102.072 Q 277.517,117.072 286.157,117.072 L 294.797,117.072" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 181 |
<path d="M315.677,132.192L360.202,132.192A15.12 15.12 0 0 0 375.322 117.072A15.12 15.12 0 0 0 360.202 101.952L315.677,101.952A15.12 15.12 0 0 0 300.557 117.072A15.12 15.12 0 0 0 315.677 132.192Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 182 |
<text x="337.939" y="117.072" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">ORDER</text> |
| 183 |
<polygon points="392.602,117.072 381.082,121.392 381.082,112.752" style="fill:rgb(0,0,0)"/> |
| 184 |
<path d="M375.322,117.072L386.842,117.072" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 185 |
<path d="M407.722,132.192L411.811,132.192A15.12 15.12 0 0 0 426.931 117.072A15.12 15.12 0 0 0 411.811 101.952L407.722,101.952A15.12 15.12 0 0 0 392.602 117.072A15.12 15.12 0 0 0 407.722 132.192Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 186 |
<text x="409.766" y="117.072" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">BY</text> |
| 187 |
<polygon points="455.731,117.072 444.211,121.392 444.211,112.752" style="fill:rgb(0,0,0)"/> |
| 188 |
<path d="M426.931,117.072L449.971,117.072" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 189 |
<path d="M455.731,132.192L585.562,132.192L585.562,101.952L455.731,101.952Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 190 |
<text x="520.646" y="117.072" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">ordering-term</text> |
| 191 |
<path d="M520.646,169.992A15.12 15.12 0 0 0 535.766 154.872A15.12 15.12 0 0 0 520.646 139.752A15.12 15.12 0 0 0 505.526 154.872A15.12 15.12 0 0 0 520.646 169.992Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 192 |
<text x="520.646" y="154.872" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">,</text> |
| 193 |
<polygon points="535.766,154.872 547.286,150.552 547.286,159.192" style="fill:rgb(0,0,0)"/> |
| 194 |
<path d="M585.562,117.072 L 591.322,117.072 Q 597.082,117.072 597.082,132.072 L 597.082,139.872 Q 597.082,154.872 582.082,154.872 L 556.526,154.872 L 541.526,154.872" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 195 |
<polygon points="455.731,117.072 444.211,121.392 444.211,112.752" style="fill:rgb(0,0,0)"/> |
| 196 |
<path d="M505.526,154.872 L 470.731,154.872 Q 455.731,154.872 447.091,154.872 Q 438.451,154.872 438.451,139.872 L 438.451,132.072 Q 438.451,117.072 444.211,117.072 L 449.971,117.072" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 197 |
<path d="M585.562,117.072 L 594.202,117.072 Q 602.842,117.072 602.842,102.072 L 602.842,71.592 Q 602.842,56.592 617.842,56.592 L 623.842,56.592 L 638.842,56.592" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 198 |
</svg> |
| 199 |
</div><br> |
| 200 |
<br></br> |
| 201 |
References: <a href='./expr.html'>expr</a> <a href='./filter-clause.html'>filter-clause</a> <a href='./ordering-term.html'>ordering-term</a><br></br> |
| 202 |
See also: <a href='../lang_aggfunc.html'>lang_aggfunc.html</a> <a href='../lang_expr.html'>lang_expr.html</a> |
| 203 |
</div> |
| 204 |
|
| 205 |
|
| 206 |
|