forked from docs/doc-exports
Reviewed-by: Wagner, Fabian <fabian.wagner@t-systems.com> Co-authored-by: Ru, Li Yi <liyiru7@huawei.com> Co-committed-by: Ru, Li Yi <liyiru7@huawei.com>
19 lines
1.1 KiB
HTML
19 lines
1.1 KiB
HTML
<a name="ddm_08_0011"></a><a name="ddm_08_0011"></a>
|
|
|
|
<h1 class="topictitle1">SELECT UNION Syntax</h1>
|
|
<div id="body1597045079937"><div class="section" id="ddm_08_0011__section0452113243813"><h4 class="sectiontitle">Common Syntax</h4><pre class="screen" id="ddm_08_0011__screen1893383922719">SELECT ...UNION [ALL | DISTINCT]
|
|
SELECT ...[UNION [ALL | DISTINCT] SELECT ...]</pre>
|
|
</div>
|
|
<div class="section" id="ddm_08_0011__section9756736185817"><h4 class="sectiontitle">Example</h4><pre class="screen" id="ddm_08_0011__screen1123984413581">select userid from user union select orderid from ordertbl order by userid;
|
|
select userid from user union (select orderid from ordertbl group by orderid) order by userid;</pre>
|
|
</div>
|
|
<div class="section" id="ddm_08_0011__section1277220401952"><h4 class="sectiontitle">Syntax Restrictions</h4><p id="ddm_08_0011__p11235831125815">SELECT statements in UNION do not support duplicate column names.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="ddm_08_0004.html">DML</a></div>
|
|
</div>
|
|
</div>
|
|
|