| 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: window-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'>window-function-invocation</h1> |
| 119 |
<div class='imgcontainer'> |
| 120 |
<div style="max-width:870px"><svg xmlns='http://www.w3.org/2000/svg' style='font-size:initial;' class="pikchr" viewBox="0 0 870.446 132.84" data-pikchr-date="20250319161943"> |
| 121 |
<circle cx="5.76" cy="55.08" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 122 |
<polygon points="32.4,55.08 20.88,59.4 20.88,50.76" style="fill:rgb(0,0,0)"/> |
| 123 |
<path d="M9.36,55.08L26.64,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 124 |
<path d="M47.52,70.2L135.13,70.2A15.12 15.12 0 0 0 150.25 55.08A15.12 15.12 0 0 0 135.13 39.96L47.52,39.96A15.12 15.12 0 0 0 32.4 55.08A15.12 15.12 0 0 0 47.52 70.2Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 125 |
<text x="91.3248" y="55.08" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">window-func</text> |
| 126 |
<polygon points="167.53,55.08 156.01,59.4 156.01,50.76" style="fill:rgb(0,0,0)"/> |
| 127 |
<path d="M150.25,55.08L161.77,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 128 |
<path d="M182.65,70.2A15.12 15.12 0 0 0 197.77 55.08A15.12 15.12 0 0 0 182.65 39.96A15.12 15.12 0 0 0 167.53 55.08A15.12 15.12 0 0 0 182.65 70.2Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 129 |
<text x="182.65" y="55.08" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">(</text> |
| 130 |
<polygon points="251.77,55.08 240.25,59.4 240.25,50.76" style="fill:rgb(0,0,0)"/> |
| 131 |
<path d="M197.77,55.08L246.01,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 132 |
<path d="M251.77,70.2L300.96,70.2L300.96,39.96L251.77,39.96Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 133 |
<text x="276.365" y="55.08" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">expr</text> |
| 134 |
<polygon points="354.96,55.08 343.44,59.4 343.44,50.76" style="fill:rgb(0,0,0)"/> |
| 135 |
<path d="M300.96,55.08L349.2,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 136 |
<path d="M370.08,70.2A15.12 15.12 0 0 0 385.2 55.08A15.12 15.12 0 0 0 370.08 39.96A15.12 15.12 0 0 0 354.96 55.08A15.12 15.12 0 0 0 370.08 70.2Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 137 |
<text x="370.08" y="55.08" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">)</text> |
| 138 |
<polygon points="426.72,85.32 415.2,89.64 415.2,81" style="fill:rgb(0,0,0)"/> |
| 139 |
<path d="M385.2,55.08 L 392.7,55.08 Q 400.2,55.08 400.2,70.08 L 400.2,70.32 Q 400.2,85.32 410.58,85.32 L 420.96,85.32" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 140 |
<path d="M426.72,100.44L538.81,100.44L538.81,70.2L426.72,70.2Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 141 |
<text x="482.765" y="85.32" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">filter-clause</text> |
| 142 |
<polygon points="580.33,55.08 568.81,59.4 568.81,50.76" style="fill:rgb(0,0,0)"/> |
| 143 |
<path d="M538.81,85.32 L 546.31,85.32 Q 553.81,85.32 553.81,70.32 L 553.81,70.08 Q 553.81,55.08 564.19,55.08 L 574.57,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 144 |
<path d="M595.45,70.2L626.15,70.2A15.12 15.12 0 0 0 641.27 55.08A15.12 15.12 0 0 0 626.15 39.96L595.45,39.96A15.12 15.12 0 0 0 580.33 55.08A15.12 15.12 0 0 0 595.45 70.2Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 145 |
<text x="610.8" y="55.08" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">OVER</text> |
| 146 |
<polygon points="682.79,92.88 671.27,97.2 671.27,88.56" style="fill:rgb(0,0,0)"/> |
| 147 |
<path d="M641.27,55.08 L 648.77,55.08 Q 656.27,55.08 656.27,70.08 L 656.27,77.88 Q 656.27,92.88 666.65,92.88 L 677.03,92.88" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 148 |
<path d="M697.91,108L794.966,108A15.12 15.12 0 0 0 810.086 92.88L810.086,92.88A15.12 15.12 0 0 0 794.966 77.76L697.91,77.76A15.12 15.12 0 0 0 682.79 92.88L682.79,92.88A15.12 15.12 0 0 0 697.91 108Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 149 |
<text x="746.438" y="92.88" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">window-name</text> |
| 150 |
<polygon points="861.086,55.08 849.566,59.4 849.566,50.76" style="fill:rgb(0,0,0)"/> |
| 151 |
<path d="M810.086,92.88 L 817.586,92.88 Q 825.086,92.88 825.086,77.88 L 825.086,70.08 Q 825.086,55.08 840.086,55.08 L 840.326,55.08 L 855.326,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 152 |
<circle cx="864.686" cy="55.08" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 153 |
<path d="M385.2,55.08L568.81,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 154 |
<polygon points="682.79,55.08 671.27,59.4 671.27,50.76" style="fill:rgb(0,0,0)"/> |
| 155 |
<path d="M641.27,55.08L677.03,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 156 |
<path d="M682.79,70.2L801.216,70.2L801.216,39.96L682.79,39.96Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 157 |
<text x="742.003" y="55.08" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">window-defn</text> |
| 158 |
<path d="M801.216,55.08L849.566,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 159 |
<path d="M276.365,32.4A15.12 15.12 0 0 0 291.485 17.28L291.485,17.28A15.12 15.12 0 0 0 276.365 2.16A15.12 15.12 0 0 0 261.245 17.28L261.245,17.28A15.12 15.12 0 0 0 276.365 32.4Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 160 |
<text x="276.365" y="17.28" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">,</text> |
| 161 |
<polygon points="291.485,17.28 303.005,12.96 303.005,21.6" style="fill:rgb(0,0,0)"/> |
| 162 |
<path d="M300.96,55.08 L 308.46,55.08 Q 315.96,55.08 315.96,40.08 L 315.96,32.28 Q 315.96,17.28 306.602,17.28 L 297.245,17.28" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 163 |
<path d="M261.245,17.28 L 240.25,17.28 Q 225.25,17.28 225.25,32.28 L 225.25,40.08 Q 225.25,55.08 232.75,55.08 L 240.25,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 164 |
<polygon points="276.365,85.32 264.845,89.64 264.845,81" style="fill:rgb(0,0,0)"/> |
| 165 |
<path d="M197.77,55.08 L 205.27,55.08 Q 212.77,55.08 212.77,70.08 L 212.77,70.32 Q 212.77,85.32 227.77,85.32 L 255.605,85.32 L 270.605,85.32" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 166 |
<path d="M276.365,85.32 L 313.44,85.32 Q 328.44,85.32 328.44,70.32 L 328.44,70.08 Q 328.44,55.08 335.94,55.08 L 343.44,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 167 |
<path d="M276.365,130.68A15.12 15.12 0 0 0 291.485 115.56L291.485,115.56A15.12 15.12 0 0 0 276.365 100.44A15.12 15.12 0 0 0 261.245 115.56L261.245,115.56A15.12 15.12 0 0 0 276.365 130.68Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 168 |
<text x="276.365" y="115.56" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">*</text> |
| 169 |
<polygon points="261.245,115.56 249.725,119.88 249.725,111.24" style="fill:rgb(0,0,0)"/> |
| 170 |
<path d="M197.77,55.08 L 205.27,55.08 Q 212.77,55.08 212.77,70.08 L 212.77,100.56 Q 212.77,115.56 227.77,115.56 L 240.485,115.56 L 255.485,115.56" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 171 |
<path d="M291.485,115.56 L 313.44,115.56 Q 328.44,115.56 328.44,100.56 L 328.44,70.08 Q 328.44,55.08 335.94,55.08 L 343.44,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 172 |
</svg> |
| 173 |
</div><br> |
| 174 |
<br></br> |
| 175 |
References: <a href='./expr.html'>expr</a> <a href='./filter-clause.html'>filter-clause</a> <a href='./window-defn.html'>window-defn</a><br></br> |
| 176 |
See also: <a href='../lang_expr.html'>lang_expr.html</a> |
| 177 |
</div> |
| 178 |
|
| 179 |
|
| 180 |
|