forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com> Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
25 lines
1.7 KiB
HTML
25 lines
1.7 KiB
HTML
<a name="dli_08_15009"></a><a name="dli_08_15009"></a>
|
|
|
|
<h1 class="topictitle1">CREATE VIEW</h1>
|
|
<div id="body0000001309855865"><div class="section" id="dli_08_15009__section183089392017"><h4 class="sectiontitle">Function</h4><p id="dli_08_15009__p126112237144">This statement creates a view based on the given query statement. If a view with the same name already exists in the database, an exception is thrown.</p>
|
|
</div>
|
|
<div class="section" id="dli_08_15009__section16504719106"><h4 class="sectiontitle">Syntax</h4><pre class="screen" id="dli_08_15009__screen162243271009">CREATE [TEMPORARY] VIEW [IF NOT EXISTS] [catalog_name.][db_name.]view_name
|
|
[{columnName [, columnName ]* }] [COMMENT view_comment]
|
|
AS query_expression</pre>
|
|
</div>
|
|
<div class="section" id="dli_08_15009__section116236818"><h4 class="sectiontitle">Description</h4><p id="dli_08_15009__p464516257476"><strong id="dli_08_15009__b43424371475">TEMPORARY</strong></p>
|
|
<p id="dli_08_15009__p1264552534715">Create a temporary view with catalogs and database namespaces and overwrite the original view.</p>
|
|
<p id="dli_08_15009__p115837207116"><strong id="dli_08_15009__b8926433211">IF NOT EXISTS</strong></p>
|
|
<p id="dli_08_15009__p175830202014">If the view already exists, nothing happens.</p>
|
|
</div>
|
|
<div class="section" id="dli_08_15009__section782675114136"><h4 class="sectiontitle">Example</h4><p id="dli_08_15009__p11481194121412">Create a view named <strong id="dli_08_15009__b9982746345021">viewName</strong>.</p>
|
|
<pre class="screen" id="dli_08_15009__screen3548125661319">create view viewName as select * from dataSource</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_08_15005.html">Data Definition Language (DDL)</a></div>
|
|
</div>
|
|
</div>
|
|
|