| 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: create-view-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.gif" 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'>create-view-stmt</h1> |
| 119 |
<div class='imgcontainer'> |
| 120 |
<div style="max-width:885px"><svg xmlns='http://www.w3.org/2000/svg' class="pikchr" viewBox="0 0 885.677 232.632"> |
| 121 |
<circle cx="5" cy="17" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 122 |
<polygon points="32,17 20,21 20,12" style="fill:rgb(0,0,0)"/> |
| 123 |
<path d="M9,17L26,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 124 |
<path d="M47,32L100,32A15 15 0 0 0 116 17A15 15 0 0 0 100 2L47,2A15 15 0 0 0 32 17A15 15 0 0 0 47 32Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 125 |
<text x="74" y="17" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">CREATE</text> |
| 126 |
<path d="M167,56L199,56A15 15 0 0 0 214 41A15 15 0 0 0 199 26L167,26A15 15 0 0 0 152 41A15 15 0 0 0 167 56Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 127 |
<text x="183" y="41" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">TEMP</text> |
| 128 |
<path d="M167,94L259,94A15 15 0 0 0 274 79A15 15 0 0 0 259 64L167,64A15 15 0 0 0 152 79A15 15 0 0 0 167 94Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 129 |
<text x="213" y="79" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">TEMPORARY</text> |
| 130 |
<path d="M325,32L355,32A15 15 0 0 0 370 17A15 15 0 0 0 355 2L325,2A15 15 0 0 0 310 17A15 15 0 0 0 325 32Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 131 |
<text x="340" y="17" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">VIEW</text> |
| 132 |
<polygon points="213,17 201,21 201,12" style="fill:rgb(0,0,0)"/> |
| 133 |
<path d="M116,17L207,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 134 |
<polygon points="310,17 299,21 299,12" style="fill:rgb(0,0,0)"/> |
| 135 |
<path d="M213,17L305,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 136 |
<polygon points="152,41 140,45 140,37" style="fill:rgb(0,0,0)"/> |
| 137 |
<path d="M116,17 L 123,17 Q 131,17 131,29 Q 131,41 138,41 L 146,41" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 138 |
<polygon points="152,79 140,83 140,74" style="fill:rgb(0,0,0)"/> |
| 139 |
<path d="M116,17 L 123,17 Q 131,17 131,32 L 131,64 Q 131,79 138,79 L 146,79" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 140 |
<path d="M274,79 L 282,79 Q 289,79 289,64 L 289,32 Q 289,17 294,17 L 299,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 141 |
<path d="M214,41 L 274,41 Q 289,41 289,33 L 289,26" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 142 |
<polygon points="406,17 394,21 394,12" style="fill:rgb(0,0,0)"/> |
| 143 |
<path d="M370,17L400,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 144 |
<path d="M421,32A15 15 0 0 0 436 17A15 15 0 0 0 421 2A15 15 0 0 0 406 17A15 15 0 0 0 421 32Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 145 |
<text x="421" y="17" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">IF</text> |
| 146 |
<polygon points="459,17 447,21 447,12" style="fill:rgb(0,0,0)"/> |
| 147 |
<path d="M436,17L453,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 148 |
<path d="M474,32L494,32A15 15 0 0 0 509 17A15 15 0 0 0 494 2L474,2A15 15 0 0 0 459 17A15 15 0 0 0 474 32Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 149 |
<text x="484" y="17" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">NOT</text> |
| 150 |
<polygon points="532,17 521,21 521,12" style="fill:rgb(0,0,0)"/> |
| 151 |
<path d="M509,17L527,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 152 |
<path d="M547,32L592,32A15 15 0 0 0 607 17A15 15 0 0 0 592 2L547,2A15 15 0 0 0 532 17A15 15 0 0 0 547 32Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 153 |
<text x="570" y="17" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">EXISTS</text> |
| 154 |
<polygon points="213,109 224,105 224,113" style="fill:rgb(0,0,0)"/> |
| 155 |
<path d="M370,17 L 377,17 Q 385,17 385,32 L 385,94 Q 385,109 370,109 L 234,109 L 219,109" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 156 |
<polygon points="532,109 544,105 544,113" style="fill:rgb(0,0,0)"/> |
| 157 |
<path d="M607,17 L 615,17 Q 622,17 622,32 L 622,94 Q 622,109 607,109 L 553,109 L 538,109" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 158 |
<path d="M532,109L310,109" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 159 |
<polygon points="28,147 17,151 17,142" style="fill:rgb(0,0,0)"/> |
| 160 |
<path d="M310,109 L 20,109 Q 5,109 5,124 L 5,132 Q 5,147 14,147 L 23,147" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 161 |
<path d="M43,162L140,162A15 15 0 0 0 155 147A15 15 0 0 0 140 132L43,132A15 15 0 0 0 28 147A15 15 0 0 0 43 162Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 162 |
<text x="92" y="147" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">schema-name</text> |
| 163 |
<polygon points="178,147 166,151 166,142" style="fill:rgb(0,0,0)"/> |
| 164 |
<path d="M155,147L172,147" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 165 |
<path d="M193,162A15 15 0 0 0 208 147A15 15 0 0 0 193 132A15 15 0 0 0 178 147A15 15 0 0 0 193 162Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 166 |
<text x="193" y="147" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">.</text> |
| 167 |
<polygon points="244,147 233,151 233,142" style="fill:rgb(0,0,0)"/> |
| 168 |
<path d="M208,147L238,147" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 169 |
<path d="M259,162L330,162A15 15 0 0 0 345 147A15 15 0 0 0 330 132L259,132A15 15 0 0 0 244 147A15 15 0 0 0 259 162Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 170 |
<text x="295" y="147" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">view-name</text> |
| 171 |
<polygon points="383,177 372,181 372,173" style="fill:rgb(0,0,0)"/> |
| 172 |
<path d="M345,147 L 353,147 Q 360,147 360,162 L 360,162 Q 360,177 369,177 L 378,177" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 173 |
<path d="M399,192A15 15 0 0 0 414 177A15 15 0 0 0 399 162A15 15 0 0 0 383 177A15 15 0 0 0 399 192Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 174 |
<text x="399" y="177" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">(</text> |
| 175 |
<polygon points="450,177 438,181 438,173" style="fill:rgb(0,0,0)"/> |
| 176 |
<path d="M414,177L444,177" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 177 |
<path d="M465,192L559,192A15 15 0 0 0 574 177A15 15 0 0 0 559 162L465,162A15 15 0 0 0 450 177A15 15 0 0 0 465 192Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 178 |
<text x="512" y="177" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">column-name</text> |
| 179 |
<polygon points="610,177 599,181 599,173" style="fill:rgb(0,0,0)"/> |
| 180 |
<path d="M574,177L604,177" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 181 |
<path d="M625,192A15 15 0 0 0 640 177A15 15 0 0 0 625 162A15 15 0 0 0 610 177A15 15 0 0 0 625 192Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 182 |
<text x="625" y="177" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">)</text> |
| 183 |
<polygon points="678,147 667,151 667,142" style="fill:rgb(0,0,0)"/> |
| 184 |
<path d="M640,177 L 648,177 Q 655,177 655,162 L 655,162 Q 655,147 664,147 L 673,147" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 185 |
<path d="M693,162L697,162A15 15 0 0 0 713 147A15 15 0 0 0 697 132L693,132A15 15 0 0 0 678 147A15 15 0 0 0 693 162Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 186 |
<text x="695" y="147" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">AS</text> |
| 187 |
<polygon points="736,147 724,151 724,142" style="fill:rgb(0,0,0)"/> |
| 188 |
<path d="M713,147L730,147" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 189 |
<path d="M736,162L840,162L840,132L736,132Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 190 |
<text x="788" y="147" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">select-stmt</text> |
| 191 |
<polygon points="876,147 864,151 864,142" style="fill:rgb(0,0,0)"/> |
| 192 |
<path d="M840,147L870,147" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 193 |
<circle cx="879" cy="147" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 194 |
<polygon points="92,177 80,181 80,173" style="fill:rgb(0,0,0)"/> |
| 195 |
<path d="M5,132 L 5,162 Q 5,177 20,177 L 71,177 L 86,177" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 196 |
<path d="M92,177 L 206,177 Q 221,177 221,162 L 221,162 Q 221,147 227,147 L 233,147" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 197 |
<polygon points="512,147 500,151 500,142" style="fill:rgb(0,0,0)"/> |
| 198 |
<path d="M345,147L506,147" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 199 |
<path d="M512,147L667,147" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 200 |
<path d="M512,230A15 15 0 0 0 527 215A15 15 0 0 0 512 200A15 15 0 0 0 497 215A15 15 0 0 0 512 230Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 201 |
<text x="512" y="215" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">,</text> |
| 202 |
<polygon points="527,215 539,211 539,219" style="fill:rgb(0,0,0)"/> |
| 203 |
<path d="M574,177 L 582,177 Q 589,177 589,192 L 589,200 Q 589,215 574,215 L 548,215 L 533,215" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 204 |
<path d="M497,215 L 442,215 Q 427,215 427,200 L 427,192 Q 427,177 434,177 L 442,177" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 205 |
</svg> |
| 206 |
</div><br> |
| 207 |
|
| 208 |
Used by: <a href='./sql-stmt.html'>sql-stmt</a><br></br> |
| 209 |
References: <a href='./select-stmt.html'>select-stmt</a><br></br> |
| 210 |
See also: <a href='../lang_createview.html'>lang_createview.html</a> |
| 211 |
</div> |
| 212 |
|
| 213 |
|
| 214 |
|