summaryrefslogtreecommitdiffstats
path: root/www/syntax/factored-select-stmt.html
blob: 4b90a2b3f0d8dcd426d553b5aef373c7e5fd8800 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!DOCTYPE html>
<html><head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link href="../sqlite.css" rel="stylesheet">
<title>SQLite Syntax: factored-select-stmt</title>
<!-- path=../ -->
</head>
<body>
<div class=nosearch>
<a href="../index.html">
<img class="logo" src="../images/sqlite370_banner.gif" alt="SQLite" border="0">
</a>
<div><!-- IE hack to prevent disappearing logo --></div>
<div class="tagline desktoponly">
Small. Fast. Reliable.<br>Choose any three.
</div>
<div class="menu mainmenu">
<ul>
<li><a href="../index.html">Home</a>
<li class='mobileonly'><a href="javascript:void(0)" onclick='toggle_div("submenu")'>Menu</a>
<li class='wideonly'><a href='../about.html'>About</a>
<li class='desktoponly'><a href="../docs.html">Documentation</a>
<li class='desktoponly'><a href="../download.html">Download</a>
<li class='wideonly'><a href='../copyright.html'>License</a>
<li class='desktoponly'><a href="../support.html">Support</a>
<li class='desktoponly'><a href="../prosupport.html">Purchase</a>
<li class='search' id='search_menubutton'>
<a href="javascript:void(0)" onclick='toggle_search()'>Search</a>
</ul>
</div>
<div class="menu submenu" id="submenu">
<ul>
<li><a href='../about.html'>About</a>
<li><a href='../docs.html'>Documentation</a>
<li><a href='../download.html'>Download</a>
<li><a href='../support.html'>Support</a>
<li><a href='../prosupport.html'>Purchase</a>
</ul>
</div>
<div class="searchmenu" id="searchmenu">
<form method="GET" action="../search">
<select name="s" id="searchtype">
<option value="d">Search Documentation</option>
<option value="c">Search Changelog</option>
</select>
<input type="text" name="q" id="searchbox" value="">
<input type="submit" value="Go">
</form>
</div>
</div>
<script>
function toggle_div(nm) {
var w = document.getElementById(nm);
if( w.style.display=="block" ){
w.style.display = "none";
}else{
w.style.display = "block";
}
}
function toggle_search() {
var w = document.getElementById("searchmenu");
if( w.style.display=="block" ){
w.style.display = "none";
} else {
w.style.display = "block";
setTimeout(function(){
document.getElementById("searchbox").focus()
}, 30);
}
}
function div_off(nm){document.getElementById(nm).style.display="none";}
window.onbeforeunload = function(e){div_off("submenu");}
/* Disable the Search feature if we are not operating from CGI, since */
/* Search is accomplished using CGI and will not work without it. */
if( !location.origin || !location.origin.match || !location.origin.match(/http/) ){
document.getElementById("search_menubutton").style.display = "none";
}
/* Used by the Hide/Show button beside syntax diagrams, to toggle the */
function hideorshow(btn,obj){
var x = document.getElementById(obj);
var b = document.getElementById(btn);
if( x.style.display!='none' ){
x.style.display = 'none';
b.innerHTML='show';
}else{
x.style.display = '';
b.innerHTML='hide';
}
return false;
}
var antiRobot = 0;
function antiRobotGo(){
if( antiRobot!=3 ) return;
antiRobot = 7;
var j = document.getElementById("mtimelink");
if(j && j.hasAttribute("data-href")) j.href=j.getAttribute("data-href");
}
function antiRobotDefense(){
document.body.onmousedown=function(){
antiRobot |= 2;
antiRobotGo();
document.body.onmousedown=null;
}
document.body.onmousemove=function(){
antiRobot |= 2;
antiRobotGo();
document.body.onmousemove=null;
}
setTimeout(function(){
antiRobot |= 1;
antiRobotGo();
}, 100)
antiRobotGo();
}
antiRobotDefense();
</script>
<h1 align='center'>factored-select-stmt</h1>
<div class='imgcontainer'>
<div style="max-width:629px"><svg xmlns='http://www.w3.org/2000/svg' class="pikchr" viewBox="0 0 629.266 500.04">
<circle cx="5" cy="17" r="3.6"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="45,17 33,21 33,12" style="fill:rgb(0,0,0)"/>
<path d="M9,17L39,17"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M60,32L91,32A15 15 0 0 0 106 17A15 15 0 0 0 91 2L60,2A15 15 0 0 0 45 17A15 15 0 0 0 60 32Z"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="75" y="17" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">WITH</text>
<path d="M166,62L252,62A15 15 0 0 0 267 47A15 15 0 0 0 252 32L166,32A15 15 0 0 0 151 47A15 15 0 0 0 166 62Z"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="209" y="47" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">RECURSIVE</text>
<polygon points="209,17 197,21 197,12" style="fill:rgb(0,0,0)"/>
<path d="M106,17L203,17"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="357,17 345,21 345,12" style="fill:rgb(0,0,0)"/>
<path d="M209,17L351,17"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M357,32L583,32L583,2L357,2Z"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="470" y="17" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">common-table-expression</text>
<polygon points="151,47 139,51 139,43" style="fill:rgb(0,0,0)"/>
<path d="M106,17 L 113,17 Q 121,17 121,32 L 121,32 Q 121,47 133,47 L 145,47"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="290,47 278,51 278,43" style="fill:rgb(0,0,0)"/>
<path d="M267,47L284,47"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M290,47 L 297,47 Q 305,47 305,32 L 305,32 Q 305,17 320,17 L 330,17 L 345,17"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M470,70A15 15 0 0 0 485 55L485,55A15 15 0 0 0 470 39A15 15 0 0 0 455 55L455,55A15 15 0 0 0 470 70Z"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="470" y="55" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">,</text>
<polygon points="485,55 497,50 497,59" style="fill:rgb(0,0,0)"/>
<path d="M583,17 L 591,17 Q 598,17 598,32 L 598,40 Q 598,55 583,55 L 506,55 L 491,55"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M455,55 L 349,55 Q 334,55 334,40 L 334,32 Q 334,17 340,17 L 345,17"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M117,153L220,153L220,123L117,123Z"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="169" y="138" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">select-core</text>
<path d="M60,304L105,304A15 15 0 0 0 120 289A15 15 0 0 0 105 274L60,274A15 15 0 0 0 45 289A15 15 0 0 0 60 304Z"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="82" y="289" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">ORDER</text>
<polygon points="143,289 131,293 131,285" style="fill:rgb(0,0,0)"/>
<path d="M120,289L137,289"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M158,304L162,304A15 15 0 0 0 177 289A15 15 0 0 0 162 274L158,274A15 15 0 0 0 143 289A15 15 0 0 0 158 304Z"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="160" y="289" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">BY</text>
<path d="M60,410L93,410A15 15 0 0 0 109 395A15 15 0 0 0 93 380L60,380A15 15 0 0 0 45 395A15 15 0 0 0 60 410Z"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="77" y="395" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">LIMIT</text>
<polygon points="132,395 120,399 120,390" style="fill:rgb(0,0,0)"/>
<path d="M109,395L126,395"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M132,410L181,410L181,380L132,380Z"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="156" y="395" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">expr</text>
<polygon points="117,138 105,142 105,133" style="fill:rgb(0,0,0)"/>
<path d="M9,17 L 16,17 Q 24,17 24,32 L 24,123 Q 24,138 39,138 L 96,138 L 111,138"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="312,92 323,88 323,97" style="fill:rgb(0,0,0)"/>
<path d="M583,17 L 604,17 Q 619,17 619,32 L 619,77 Q 619,92 604,92 L 333,92 L 318,92"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M312,92 L 39,92 Q 24,92 24,100 L 24,107"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M80,198L257,198L257,168L80,168Z"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="169" y="183" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">compound-operator</text>
<polygon points="257,183 269,179 269,187" style="fill:rgb(0,0,0)"/>
<path d="M272,138 L 280,138 Q 287,138 287,153 L 287,168 Q 287,183 275,183 L 263,183"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M80,183 L 65,183 Q 50,183 50,168 L 50,153 Q 50,138 58,138 L 65,138"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="296,236 308,232 308,240" style="fill:rgb(0,0,0)"/>
<path d="M220,138 L 342,138 Q 357,138 357,153 L 357,221 Q 357,236 342,236 L 317,236 L 302,236"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="45,289 33,293 33,285" style="fill:rgb(0,0,0)"/>
<path d="M296,236 L 39,236 Q 24,236 24,251 L 24,274 Q 24,289 31,289 L 39,289"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="222,289 210,293 210,285" style="fill:rgb(0,0,0)"/>
<path d="M177,289L216,289"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M222,304L352,304L352,274L222,274Z"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="287" y="289" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">ordering-term</text>
<path d="M287,342A15 15 0 0 0 302 327A15 15 0 0 0 287 312A15 15 0 0 0 272 327A15 15 0 0 0 287 342Z"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="287" y="327" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">,</text>
<polygon points="302,327 314,322 314,331" style="fill:rgb(0,0,0)"/>
<path d="M352,289 L 359,289 Q 367,289 367,304 L 367,312 Q 367,327 352,327 L 323,327 L 308,327"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M272,327 L 214,327 Q 199,327 199,312 L 199,304 Q 199,289 205,289 L 210,289"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="388,319 384,308 392,308" style="fill:rgb(0,0,0)"/>
<path d="M352,289 L 373,289 Q 388,289 388,301 L 388,313"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="198,361 210,356 210,365" style="fill:rgb(0,0,0)"/>
<path d="M388,319 L 388,346 Q 388,361 373,361 L 219,361 L 204,361"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="45,395 33,399 33,390" style="fill:rgb(0,0,0)"/>
<path d="M198,361 L 39,361 Q 24,361 24,376 L 24,380 Q 24,395 31,395 L 39,395"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="24,327 20,315 28,315" style="fill:rgb(0,0,0)"/>
<path d="M24,274L24,321"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M24,327L24,380"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M255,440L306,440A15 15 0 0 0 321 425A15 15 0 0 0 306 410L255,410A15 15 0 0 0 240 425A15 15 0 0 0 255 440Z"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="281" y="425" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">OFFSET</text>
<polygon points="344,425 333,429 333,421" style="fill:rgb(0,0,0)"/>
<path d="M321,425L339,425"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M344,440L394,440L394,410L344,410Z"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="369" y="425" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">expr</text>
<polygon points="417,425 405,429 405,421" style="fill:rgb(0,0,0)"/>
<path d="M394,425L411,425"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M255,478A15 15 0 0 0 270 463A15 15 0 0 0 255 448A15 15 0 0 0 240 463A15 15 0 0 0 255 478Z"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="255" y="463" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">,</text>
<polygon points="293,463 282,467 282,458" style="fill:rgb(0,0,0)"/>
<path d="M270,463L287,463"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M293,478L342,478L342,448L293,448Z"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="318" y="463" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">expr</text>
<polygon points="204,395 192,399 192,390" style="fill:rgb(0,0,0)"/>
<path d="M181,395L198,395"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="240,463 228,467 228,458" style="fill:rgb(0,0,0)"/>
<path d="M204,395 L 211,395 Q 219,395 219,410 L 219,448 Q 219,463 226,463 L 234,463"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="240,425 228,429 228,421" style="fill:rgb(0,0,0)"/>
<path d="M204,395 L 211,395 Q 219,395 219,410 L 219,410 Q 219,425 226,425 L 234,425"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="417,395 405,399 405,390" style="fill:rgb(0,0,0)"/>
<path d="M204,395L411,395"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="619,493 608,497 608,489" style="fill:rgb(0,0,0)"/>
<path d="M417,395 L 438,395 Q 453,395 453,410 L 453,478 Q 453,493 468,493 L 599,493 L 614,493"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<circle cx="623" cy="493" r="3.6"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M417,425 L 438,425 Q 453,425 453,433 L 453,440"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="417,463 405,467 405,458" style="fill:rgb(0,0,0)"/>
<path d="M342,463L411,463"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M417,463 L 438,463 Q 453,463 453,470 L 453,478"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="417,493 405,497 405,489" style="fill:rgb(0,0,0)"/>
<path d="M24,380 L 24,478 Q 24,493 39,493 L 396,493 L 411,493"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M417,493L489,493"  style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
</svg>
</div><br>
<br></br>
References:&nbsp;&nbsp; <a href='./common-table-expression.html'>common-table-expression</a>&nbsp;&nbsp; <a href='./compound-operator.html'>compound-operator</a>&nbsp;&nbsp; <a href='./expr.html'>expr</a>&nbsp;&nbsp; <a href='./ordering-term.html'>ordering-term</a>&nbsp;&nbsp; <a href='./select-core.html'>select-core</a><br></br>
See also:&nbsp;&nbsp; <a href='../lang_select.html'>lang_select.html</a>
</div>