| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 2 |
<!-- |
| 3 |
Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0, |
| 4 |
and the EPL 1.0 (https://h2database.com/html/license.html). |
| 5 |
Initial Developer: H2 Group |
| 6 |
--> |
| 7 |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> |
| 8 |
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> |
| 9 |
<meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 10 |
<title> |
| 11 |
Window Functions |
| 12 |
</title> |
| 13 |
<link rel="stylesheet" type="text/css" href="stylesheet.css" /> |
| 14 |
<!-- [search] { --> |
| 15 |
<script type="text/javascript" src="navigation.js"></script> |
| 16 |
</head><body onload="frameMe();"> |
| 17 |
<table class="content"><tr class="content"><td class="content"><div class="contentDiv"> |
| 18 |
<!-- } --> |
| 19 |
|
| 20 |
<h1>Window Functions</h1> |
| 21 |
<h2 id="functions_window_index">Index</h2> |
| 22 |
<h3>Row Number Function</h3> |
| 23 |
<!-- syntax-start |
| 24 |
<p class="notranslate"> |
| 25 |
<c:forEach var="item" items="windowFunctionsRowNumber"> |
| 26 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 27 |
</c:forEach> |
| 28 |
</p> |
| 29 |
syntax-end --> |
| 30 |
<!-- railroad-start --> |
| 31 |
<table class="notranslate index"> |
| 32 |
<tr> |
| 33 |
<td class="index"> |
| 34 |
<c:forEach var="item" items="windowFunctionsRowNumber-0"> |
| 35 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 36 |
</c:forEach> |
| 37 |
</td><td class="index"> |
| 38 |
<c:forEach var="item" items="windowFunctionsRowNumber-1"> |
| 39 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 40 |
</c:forEach> |
| 41 |
</td><td class="index"> |
| 42 |
<c:forEach var="item" items="windowFunctionsRowNumber-2"> |
| 43 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 44 |
</c:forEach> |
| 45 |
</td> |
| 46 |
</tr> |
| 47 |
</table> |
| 48 |
<!-- railroad-end --> |
| 49 |
|
| 50 |
<h3>Rank Functions</h3> |
| 51 |
<!-- syntax-start |
| 52 |
<p class="notranslate"> |
| 53 |
<c:forEach var="item" items="windowFunctionsRank"> |
| 54 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 55 |
</c:forEach> |
| 56 |
</p> |
| 57 |
syntax-end --> |
| 58 |
<!-- railroad-start --> |
| 59 |
<table class="notranslate index"> |
| 60 |
<tr> |
| 61 |
<td class="index"> |
| 62 |
<c:forEach var="item" items="windowFunctionsRank-0"> |
| 63 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 64 |
</c:forEach> |
| 65 |
</td><td class="index"> |
| 66 |
<c:forEach var="item" items="windowFunctionsRank-1"> |
| 67 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 68 |
</c:forEach> |
| 69 |
</td><td class="index"> |
| 70 |
<c:forEach var="item" items="windowFunctionsRank-2"> |
| 71 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 72 |
</c:forEach> |
| 73 |
</td> |
| 74 |
</tr> |
| 75 |
</table> |
| 76 |
<!-- railroad-end --> |
| 77 |
|
| 78 |
<h3>Lead or Lag Functions</h3> |
| 79 |
<!-- syntax-start |
| 80 |
<p class="notranslate"> |
| 81 |
<c:forEach var="item" items="windowFunctionsLeadLag"> |
| 82 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 83 |
</c:forEach> |
| 84 |
</p> |
| 85 |
syntax-end --> |
| 86 |
<!-- railroad-start --> |
| 87 |
<table class="notranslate index"> |
| 88 |
<tr> |
| 89 |
<td class="index"> |
| 90 |
<c:forEach var="item" items="windowFunctionsLeadLag-0"> |
| 91 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 92 |
</c:forEach> |
| 93 |
</td><td class="index"> |
| 94 |
<c:forEach var="item" items="windowFunctionsLeadLag-1"> |
| 95 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 96 |
</c:forEach> |
| 97 |
</td><td class="index"> |
| 98 |
<c:forEach var="item" items="windowFunctionsLeadLag-2"> |
| 99 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 100 |
</c:forEach> |
| 101 |
</td> |
| 102 |
</tr> |
| 103 |
</table> |
| 104 |
<!-- railroad-end --> |
| 105 |
|
| 106 |
<h3>Nth Value Functions</h3> |
| 107 |
<!-- syntax-start |
| 108 |
<p class="notranslate"> |
| 109 |
<c:forEach var="item" items="windowFunctionsNth"> |
| 110 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 111 |
</c:forEach> |
| 112 |
</p> |
| 113 |
syntax-end --> |
| 114 |
<!-- railroad-start --> |
| 115 |
<table class="notranslate index"> |
| 116 |
<tr> |
| 117 |
<td class="index"> |
| 118 |
<c:forEach var="item" items="windowFunctionsNth-0"> |
| 119 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 120 |
</c:forEach> |
| 121 |
</td><td class="index"> |
| 122 |
<c:forEach var="item" items="windowFunctionsNth-1"> |
| 123 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 124 |
</c:forEach> |
| 125 |
</td><td class="index"> |
| 126 |
<c:forEach var="item" items="windowFunctionsNth-2"> |
| 127 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 128 |
</c:forEach> |
| 129 |
</td> |
| 130 |
</tr> |
| 131 |
</table> |
| 132 |
<!-- railroad-end --> |
| 133 |
|
| 134 |
<h3>Other Window Functions</h3> |
| 135 |
<!-- syntax-start |
| 136 |
<p class="notranslate"> |
| 137 |
<c:forEach var="item" items="windowFunctionsOther"> |
| 138 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 139 |
</c:forEach> |
| 140 |
</p> |
| 141 |
syntax-end --> |
| 142 |
<!-- railroad-start --> |
| 143 |
<table class="notranslate index"> |
| 144 |
<tr> |
| 145 |
<td class="index"> |
| 146 |
<c:forEach var="item" items="windowFunctionsOther-0"> |
| 147 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 148 |
</c:forEach> |
| 149 |
</td><td class="index"> |
| 150 |
<c:forEach var="item" items="windowFunctionsOther-1"> |
| 151 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 152 |
</c:forEach> |
| 153 |
</td><td class="index"> |
| 154 |
<c:forEach var="item" items="windowFunctionsOther-2"> |
| 155 |
<a href="#${item.link}" >${item.topic}</a><br /> |
| 156 |
</c:forEach> |
| 157 |
</td> |
| 158 |
</tr> |
| 159 |
</table> |
| 160 |
<!-- railroad-end --> |
| 161 |
|
| 162 |
<h2>Details</h2> |
| 163 |
<!-- railroad-start --> |
| 164 |
<p>Click on the header of the function to switch between railroad diagram and BNF.</p> |
| 165 |
<!-- railroad-end --> |
| 166 |
<p>Non-standard syntax is marked in green. Compatibility-only non-standard syntax is marked in red, |
| 167 |
don't use it unless you need it for compatibility with other databases or old versions of H2.</p> |
| 168 |
|
| 169 |
<h2>Row Number Function</h2> |
| 170 |
<c:forEach var="item" items="windowFunctionsRowNumber"> |
| 171 |
<h3 id="${item.link}" class="notranslate" onclick="switchBnf(this)">${item.topic}</h3> |
| 172 |
<!-- railroad-start --> |
| 173 |
<pre name="bnf" style="display: none"> |
| 174 |
${item.syntax} |
| 175 |
</pre> |
| 176 |
<div name="railroad"> |
| 177 |
${item.railroad} |
| 178 |
</div> |
| 179 |
<!-- railroad-end --> |
| 180 |
<!-- syntax-start |
| 181 |
<pre> |
| 182 |
${item.syntax} |
| 183 |
</pre> |
| 184 |
syntax-end --> |
| 185 |
<p>${item.text}</p> |
| 186 |
<p>Example:</p> |
| 187 |
<p class="notranslate">${item.example}</p> |
| 188 |
</c:forEach> |
| 189 |
|
| 190 |
<h2>Rank Functions</h2> |
| 191 |
<c:forEach var="item" items="windowFunctionsRank"> |
| 192 |
<h3 id="${item.link}" class="notranslate" onclick="switchBnf(this)">${item.topic}</h3> |
| 193 |
<!-- railroad-start --> |
| 194 |
<pre name="bnf" style="display: none"> |
| 195 |
${item.syntax} |
| 196 |
</pre> |
| 197 |
<div name="railroad"> |
| 198 |
${item.railroad} |
| 199 |
</div> |
| 200 |
<!-- railroad-end --> |
| 201 |
<!-- syntax-start |
| 202 |
<pre> |
| 203 |
${item.syntax} |
| 204 |
</pre> |
| 205 |
syntax-end --> |
| 206 |
<p>${item.text}</p> |
| 207 |
<p>Example:</p> |
| 208 |
<p class="notranslate">${item.example}</p> |
| 209 |
</c:forEach> |
| 210 |
|
| 211 |
<h2>Lead or Lag Functions</h2> |
| 212 |
<c:forEach var="item" items="windowFunctionsLeadLag"> |
| 213 |
<h3 id="${item.link}" class="notranslate" onclick="switchBnf(this)">${item.topic}</h3> |
| 214 |
<!-- railroad-start --> |
| 215 |
<pre name="bnf" style="display: none"> |
| 216 |
${item.syntax} |
| 217 |
</pre> |
| 218 |
<div name="railroad"> |
| 219 |
${item.railroad} |
| 220 |
</div> |
| 221 |
<!-- railroad-end --> |
| 222 |
<!-- syntax-start |
| 223 |
<pre> |
| 224 |
${item.syntax} |
| 225 |
</pre> |
| 226 |
syntax-end --> |
| 227 |
<p>${item.text}</p> |
| 228 |
<p>Example:</p> |
| 229 |
<p class="notranslate">${item.example}</p> |
| 230 |
</c:forEach> |
| 231 |
|
| 232 |
<h2>Nth Value Functions</h2> |
| 233 |
<c:forEach var="item" items="windowFunctionsNth"> |
| 234 |
<h3 id="${item.link}" class="notranslate" onclick="switchBnf(this)">${item.topic}</h3> |
| 235 |
<!-- railroad-start --> |
| 236 |
<pre name="bnf" style="display: none"> |
| 237 |
${item.syntax} |
| 238 |
</pre> |
| 239 |
<div name="railroad"> |
| 240 |
${item.railroad} |
| 241 |
</div> |
| 242 |
<!-- railroad-end --> |
| 243 |
<!-- syntax-start |
| 244 |
<pre> |
| 245 |
${item.syntax} |
| 246 |
</pre> |
| 247 |
syntax-end --> |
| 248 |
<p>${item.text}</p> |
| 249 |
<p>Example:</p> |
| 250 |
<p class="notranslate">${item.example}</p> |
| 251 |
</c:forEach> |
| 252 |
|
| 253 |
<h2>Other Window Functions</h2> |
| 254 |
<c:forEach var="item" items="windowFunctionsOther"> |
| 255 |
<h3 id="${item.link}" class="notranslate" onclick="switchBnf(this)">${item.topic}</h3> |
| 256 |
<!-- railroad-start --> |
| 257 |
<pre name="bnf" style="display: none"> |
| 258 |
${item.syntax} |
| 259 |
</pre> |
| 260 |
<div name="railroad"> |
| 261 |
${item.railroad} |
| 262 |
</div> |
| 263 |
<!-- railroad-end --> |
| 264 |
<!-- syntax-start |
| 265 |
<pre> |
| 266 |
${item.syntax} |
| 267 |
</pre> |
| 268 |
syntax-end --> |
| 269 |
<p>${item.text}</p> |
| 270 |
<p>Example:</p> |
| 271 |
<p class="notranslate">${item.example}</p> |
| 272 |
</c:forEach> |
| 273 |
|
| 274 |
<!--[if lte IE 7]><script language="javascript">switchBnf(null);</script><![endif]--> |
| 275 |
|
| 276 |
<!-- [close] { --></div></td></tr></table><!-- } --><!-- analytics --></body></html> |
| 277 |
|