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
|
<!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: simple-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'>simple-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 348.84">
<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="M45,153L148,153L148,123L45,123Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="97" y="138" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">select-core</text>
<path d="M205,153L250,153A15 15 0 0 0 265 138A15 15 0 0 0 250 123L205,123A15 15 0 0 0 190 138A15 15 0 0 0 205 153Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="227" y="138" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">ORDER</text>
<polygon points="288,138 276,142 276,133" style="fill:rgb(0,0,0)"/>
<path d="M265,138L282,138" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M303,153L307,153A15 15 0 0 0 322 138A15 15 0 0 0 307 123L303,123A15 15 0 0 0 288 138A15 15 0 0 0 303 153Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="305" y="138" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">BY</text>
<path d="M205,259L239,259A15 15 0 0 0 254 244A15 15 0 0 0 239 228L205,228A15 15 0 0 0 190 244A15 15 0 0 0 205 259Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="222" y="244" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">LIMIT</text>
<polygon points="277,244 265,248 265,239" style="fill:rgb(0,0,0)"/>
<path d="M254,244L271,244" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M277,259L326,259L326,228L277,228Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="301" y="244" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">expr</text>
<polygon points="45,138 33,142 33,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 31,138 L 39,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);" />
<polygon points="367,138 356,142 356,133" style="fill:rgb(0,0,0)"/>
<path d="M322,138L361,138" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M367,153L497,153L497,123L367,123Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="432" y="138" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">ordering-term</text>
<path d="M432,191A15 15 0 0 0 447 176A15 15 0 0 0 432 160A15 15 0 0 0 417 176A15 15 0 0 0 432 191Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="432" y="176" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">,</text>
<polygon points="447,176 459,171 459,180" style="fill:rgb(0,0,0)"/>
<path d="M497,138 L 504,138 Q 512,138 512,153 L 512,161 Q 512,176 497,176 L 468,176 L 453,176" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M417,176 L 359,176 Q 344,176 344,161 L 344,153 Q 344,138 350,138 L 356,138" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="533,168 529,156 537,156" style="fill:rgb(0,0,0)"/>
<path d="M497,138 L 518,138 Q 533,138 533,150 L 533,162" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="343,210 355,205 355,214" style="fill:rgb(0,0,0)"/>
<path d="M533,168 L 533,195 Q 533,210 518,210 L 364,210 L 349,210" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="190,244 178,248 178,239" style="fill:rgb(0,0,0)"/>
<path d="M343,210 L 178,210 Q 163,210 163,225 L 163,229 Q 163,244 174,244 L 184,244" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="190,138 178,142 178,133" style="fill:rgb(0,0,0)"/>
<path d="M148,138L184,138" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="163,191 159,179 168,179" style="fill:rgb(0,0,0)"/>
<path d="M148,138 L 156,138 Q 163,138 163,153 L 163,170 L 163,185" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M163,191L163,244" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M400,289L451,289A15 15 0 0 0 466 274A15 15 0 0 0 451 259L400,259A15 15 0 0 0 385 274A15 15 0 0 0 400 289Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="426" y="274" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">OFFSET</text>
<polygon points="490,274 478,278 478,270" style="fill:rgb(0,0,0)"/>
<path d="M466,274L484,274" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M490,289L539,289L539,259L490,259Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="514" y="274" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">expr</text>
<polygon points="562,274 550,278 550,270" style="fill:rgb(0,0,0)"/>
<path d="M539,274L556,274" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M400,327A15 15 0 0 0 415 312A15 15 0 0 0 400 297A15 15 0 0 0 385 312A15 15 0 0 0 400 327Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="400" y="312" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">,</text>
<polygon points="438,312 427,316 427,307" style="fill:rgb(0,0,0)"/>
<path d="M415,312L432,312" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M438,327L487,327L487,297L438,297Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="463" y="312" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">expr</text>
<polygon points="349,244 337,248 337,239" style="fill:rgb(0,0,0)"/>
<path d="M326,244L343,244" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="385,312 373,316 373,307" style="fill:rgb(0,0,0)"/>
<path d="M349,244 L 356,244 Q 364,244 364,259 L 364,297 Q 364,312 372,312 L 379,312" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="385,274 373,278 373,270" style="fill:rgb(0,0,0)"/>
<path d="M349,244 L 356,244 Q 364,244 364,259 L 364,259 Q 364,274 372,274 L 379,274" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="562,244 550,248 550,239" style="fill:rgb(0,0,0)"/>
<path d="M349,244L556,244" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="619,342 608,346 608,338" style="fill:rgb(0,0,0)"/>
<path d="M562,244 L 583,244 Q 598,244 598,259 L 598,327 Q 598,342 606,342 L 614,342" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<circle cx="623" cy="342" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M562,274 L 583,274 Q 598,274 598,281 L 598,289" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="562,312 550,316 550,307" style="fill:rgb(0,0,0)"/>
<path d="M487,312L556,312" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M562,312 L 583,312 Q 598,312 598,319 L 598,327" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="562,342 550,346 550,338" style="fill:rgb(0,0,0)"/>
<path d="M163,228 L 163,327 Q 163,342 178,342 L 541,342 L 556,342" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M562,342L608,342" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
</svg>
</div><br>
<br></br>
References: <a href='./common-table-expression.html'>common-table-expression</a> <a href='./expr.html'>expr</a> <a href='./ordering-term.html'>ordering-term</a> <a href='./select-core.html'>select-core</a><br></br>
See also: <a href='../lang_select.html'>lang_select.html</a>
</div>
|