Debian Codegraph @

www/syntax/simple-select-stmt.html

raw
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: simple-select-stmt</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'>simple-select-stmt</h1>
119 <div class='imgcontainer'>
120 <div style="max-width:629px"><svg xmlns='http://www.w3.org/2000/svg' style='font-size:initial;' class="pikchr" viewBox="0 0 629.266 348.84" data-pikchr-date="20250319161943">
121 <circle cx="5.76" cy="17.28" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
122 <polygon points="45.36,17.28 33.84,21.6 33.84,12.96" style="fill:rgb(0,0,0)"/>
123 <path d="M9.36,17.28L39.6,17.28" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
124 <path d="M60.48,32.4L91.296,32.4A15.12 15.12 0 0 0 106.416 17.28A15.12 15.12 0 0 0 91.296 2.16L60.48,2.16A15.12 15.12 0 0 0 45.36 17.28A15.12 15.12 0 0 0 60.48 32.4Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
125 <text x="75.888" y="17.28" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">WITH</text>
126 <path d="M166.536,62.64L252.302,62.64A15.12 15.12 0 0 0 267.422 47.52A15.12 15.12 0 0 0 252.302 32.4L166.536,32.4A15.12 15.12 0 0 0 151.416 47.52A15.12 15.12 0 0 0 166.536 62.64Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
127 <text x="209.419" y="47.52" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">RECURSIVE</text>
128 <polygon points="209.419,17.28 197.899,21.6 197.899,12.96" style="fill:rgb(0,0,0)"/>
129 <path d="M106.416,17.28L203.659,17.28" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
130 <polygon points="357.422,17.28 345.902,21.6 345.902,12.96" style="fill:rgb(0,0,0)"/>
131 <path d="M209.419,17.28L351.662,17.28" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
132 <path d="M357.422,32.4L583.906,32.4L583.906,2.16L357.422,2.16Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
133 <text x="470.664" y="17.28" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">common-table-expression</text>
134 <polygon points="151.416,47.52 139.896,51.84 139.896,43.2" style="fill:rgb(0,0,0)"/>
135 <path d="M106.416,17.28 L 113.916,17.28 Q 121.416,17.28 121.416,32.28 L 121.416,32.52 Q 121.416,47.52 133.536,47.52 L 145.656,47.52" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
136 <polygon points="290.462,47.52 278.942,51.84 278.942,43.2" style="fill:rgb(0,0,0)"/>
137 <path d="M267.422,47.52L284.702,47.52" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
138 <path d="M290.462,47.52 L 297.962,47.52 Q 305.462,47.52 305.462,32.52 L 305.462,32.28 Q 305.462,17.28 320.462,17.28 L 330.902,17.28 L 345.902,17.28" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
139 <path d="M470.664,70.2A15.12 15.12 0 0 0 485.784 55.08L485.784,55.08A15.12 15.12 0 0 0 470.664 39.96A15.12 15.12 0 0 0 455.544 55.08L455.544,55.08A15.12 15.12 0 0 0 470.664 70.2Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
140 <text x="470.664" y="55.08" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">,</text>
141 <polygon points="485.784,55.08 497.304,50.76 497.304,59.4" style="fill:rgb(0,0,0)"/>
142 <path d="M583.906,17.28 L 591.406,17.28 Q 598.906,17.28 598.906,32.28 L 598.906,40.08 Q 598.906,55.08 583.906,55.08 L 506.544,55.08 L 491.544,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
143 <path d="M455.544,55.08 L 349.382,55.08 Q 334.382,55.08 334.382,40.08 L 334.382,32.28 Q 334.382,17.28 340.142,17.28 L 345.902,17.28" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
144 <path d="M45.36,153.36L148.925,153.36L148.925,123.12L45.36,123.12Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
145 <text x="97.1424" y="138.24" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">select-core</text>
146 <path d="M205.565,153.36L250.09,153.36A15.12 15.12 0 0 0 265.21 138.24A15.12 15.12 0 0 0 250.09 123.12L205.565,123.12A15.12 15.12 0 0 0 190.445 138.24A15.12 15.12 0 0 0 205.565 153.36Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
147 <text x="227.827" y="138.24" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">ORDER</text>
148 <polygon points="288.25,138.24 276.73,142.56 276.73,133.92" style="fill:rgb(0,0,0)"/>
149 <path d="M265.21,138.24L282.49,138.24" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
150 <path d="M303.37,153.36L307.459,153.36A15.12 15.12 0 0 0 322.579 138.24A15.12 15.12 0 0 0 307.459 123.12L303.37,123.12A15.12 15.12 0 0 0 288.25 138.24A15.12 15.12 0 0 0 303.37 153.36Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
151 <text x="305.414" y="138.24" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">BY</text>
152 <path d="M205.565,259.2L239.03,259.2A15.12 15.12 0 0 0 254.15 244.08A15.12 15.12 0 0 0 239.03 228.96L205.565,228.96A15.12 15.12 0 0 0 190.445 244.08A15.12 15.12 0 0 0 205.565 259.2Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
153 <text x="222.298" y="244.08" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">LIMIT</text>
154 <polygon points="277.19,244.08 265.67,248.4 265.67,239.76" style="fill:rgb(0,0,0)"/>
155 <path d="M254.15,244.08L271.43,244.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
156 <path d="M277.19,259.2L326.381,259.2L326.381,228.96L277.19,228.96Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
157 <text x="301.786" y="244.08" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">expr</text>
158 <polygon points="45.36,138.24 33.84,142.56 33.84,133.92" style="fill:rgb(0,0,0)"/>
159 <path d="M9.36,17.28 L 16.86,17.28 Q 24.36,17.28 24.36,32.28 L 24.36,123.24 Q 24.36,138.24 31.98,138.24 L 39.6,138.24" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
160 <polygon points="312.422,92.88 323.942,88.56 323.942,97.2" style="fill:rgb(0,0,0)"/>
161 <path d="M583.906,17.28 L 604.906,17.28 Q 619.906,17.28 619.906,32.28 L 619.906,77.88 Q 619.906,92.88 604.906,92.88 L 333.182,92.88 L 318.182,92.88" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
162 <path d="M312.422,92.88 L 39.36,92.88 Q 24.36,92.88 24.36,100.38 L 24.36,107.88" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
163 <polygon points="367.579,138.24 356.059,142.56 356.059,133.92" style="fill:rgb(0,0,0)"/>
164 <path d="M322.579,138.24L361.819,138.24" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
165 <path d="M367.579,153.36L497.41,153.36L497.41,123.12L367.579,123.12Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
166 <text x="432.494" y="138.24" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">ordering-term</text>
167 <path d="M432.494,191.16A15.12 15.12 0 0 0 447.614 176.04A15.12 15.12 0 0 0 432.494 160.92A15.12 15.12 0 0 0 417.374 176.04A15.12 15.12 0 0 0 432.494 191.16Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
168 <text x="432.494" y="176.04" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">,</text>
169 <polygon points="447.614,176.04 459.134,171.72 459.134,180.36" style="fill:rgb(0,0,0)"/>
170 <path d="M497.41,138.24 L 504.91,138.24 Q 512.41,138.24 512.41,153.24 L 512.41,161.04 Q 512.41,176.04 497.41,176.04 L 468.374,176.04 L 453.374,176.04" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
171 <path d="M417.374,176.04 L 359.539,176.04 Q 344.539,176.04 344.539,161.04 L 344.539,153.24 Q 344.539,138.24 350.299,138.24 L 356.059,138.24" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
172 <polygon points="533.41,168.48 529.09,156.96 537.73,156.96" style="fill:rgb(0,0,0)"/>
173 <path d="M497.41,138.24 L 518.41,138.24 Q 533.41,138.24 533.41,150.48 L 533.41,162.72" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
174 <polygon points="343.927,210.06 355.447,205.74 355.447,214.38" style="fill:rgb(0,0,0)"/>
175 <path d="M533.41,168.48 L 533.41,195.06 Q 533.41,210.06 518.41,210.06 L 364.687,210.06 L 349.687,210.06" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
176 <polygon points="190.445,244.08 178.925,248.4 178.925,239.76" style="fill:rgb(0,0,0)"/>
177 <path d="M343.927,210.06 L 178.925,210.06 Q 163.925,210.06 163.925,225.06 L 163.925,229.08 Q 163.925,244.08 174.305,244.08 L 184.685,244.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
178 <polygon points="190.445,138.24 178.925,142.56 178.925,133.92" style="fill:rgb(0,0,0)"/>
179 <path d="M148.925,138.24L184.685,138.24" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
180 <polygon points="163.925,191.232 159.605,179.712 168.245,179.712" style="fill:rgb(0,0,0)"/>
181 <path d="M148.925,138.24 L 156.425,138.24 Q 163.925,138.24 163.925,153.24 L 163.925,170.472 L 163.925,185.472" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
182 <path d="M163.925,191.232L163.925,244.224" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
183 <path d="M400.541,289.44L451.862,289.44A15.12 15.12 0 0 0 466.982 274.32A15.12 15.12 0 0 0 451.862 259.2L400.541,259.2A15.12 15.12 0 0 0 385.421 274.32A15.12 15.12 0 0 0 400.541 289.44Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
184 <text x="426.202" y="274.32" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">OFFSET</text>
185 <polygon points="490.022,274.32 478.502,278.64 478.502,270" style="fill:rgb(0,0,0)"/>
186 <path d="M466.982,274.32L484.262,274.32" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
187 <path d="M490.022,289.44L539.213,289.44L539.213,259.2L490.022,259.2Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
188 <text x="514.618" y="274.32" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">expr</text>
189 <polygon points="562.253,274.32 550.733,278.64 550.733,270" style="fill:rgb(0,0,0)"/>
190 <path d="M539.213,274.32L556.493,274.32" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
191 <path d="M400.541,327.24A15.12 15.12 0 0 0 415.661 312.12A15.12 15.12 0 0 0 400.541 297A15.12 15.12 0 0 0 385.421 312.12A15.12 15.12 0 0 0 400.541 327.24Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
192 <text x="400.541" y="312.12" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">,</text>
193 <polygon points="438.701,312.12 427.181,316.44 427.181,307.8" style="fill:rgb(0,0,0)"/>
194 <path d="M415.661,312.12L432.941,312.12" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
195 <path d="M438.701,327.24L487.891,327.24L487.891,297L438.701,297Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
196 <text x="463.296" y="312.12" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">expr</text>
197 <polygon points="349.421,244.08 337.901,248.4 337.901,239.76" style="fill:rgb(0,0,0)"/>
198 <path d="M326.381,244.08L343.661,244.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
199 <polygon points="385.421,312.12 373.901,316.44 373.901,307.8" style="fill:rgb(0,0,0)"/>
200 <path d="M349.421,244.08 L 356.921,244.08 Q 364.421,244.08 364.421,259.08 L 364.421,297.12 Q 364.421,312.12 372.041,312.12 L 379.661,312.12" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
201 <polygon points="385.421,274.32 373.901,278.64 373.901,270" style="fill:rgb(0,0,0)"/>
202 <path d="M349.421,244.08 L 356.921,244.08 Q 364.421,244.08 364.421,259.08 L 364.421,259.32 Q 364.421,274.32 372.041,274.32 L 379.661,274.32" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
203 <polygon points="562.253,244.08 550.733,248.4 550.733,239.76" style="fill:rgb(0,0,0)"/>
204 <path d="M349.421,244.08L556.493,244.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
205 <polygon points="619.906,342.36 608.386,346.68 608.386,338.04" style="fill:rgb(0,0,0)"/>
206 <path d="M562.253,244.08 L 583.253,244.08 Q 598.253,244.08 598.253,259.08 L 598.253,327.36 Q 598.253,342.36 606.199,342.36 L 614.146,342.36" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
207 <circle cx="623.506" cy="342.36" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
208 <path d="M562.253,274.32 L 583.253,274.32 Q 598.253,274.32 598.253,281.82 L 598.253,289.32" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
209 <polygon points="562.253,312.12 550.733,316.44 550.733,307.8" style="fill:rgb(0,0,0)"/>
210 <path d="M487.891,312.12L556.493,312.12" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
211 <path d="M562.253,312.12 L 583.253,312.12 Q 598.253,312.12 598.253,319.62 L 598.253,327.12" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
212 <polygon points="562.253,342.36 550.733,346.68 550.733,338.04" style="fill:rgb(0,0,0)"/>
213 <path d="M163.925,228.96 L 163.925,327.36 Q 163.925,342.36 178.925,342.36 L 541.493,342.36 L 556.493,342.36" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
214 <path d="M562.253,342.36L608.386,342.36" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
215 </svg>
216 </div><br>
217 <br></br>
218 References:&nbsp;&nbsp; <a href='./common-table-expression.html'>common-table-expression</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>
219 See also:&nbsp;&nbsp; <a href='../lang_select.html'>lang_select.html</a>
220 </div>
221
222
223