blob: 3dc76e10b49b2785c078031715e25253c3f6192c [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2020 IBM Corporation.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
which accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Andrew Johnson (IBM Corporation) - initial API and implementation
-->
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd" >
<reference id="ref_oqlsyntaxunion" xml:lang="en-us">
<title>UNION Clause</title>
<shortdesc />
<prolog>
<copyright>
<copyryear year=""></copyryear>
<copyrholder>
Copyright (c) 2020 IBM Corporation.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
which accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-2.0/
</copyrholder>
</copyright>
</prolog>
<refbody>
<section>
<p>
The <codeph>UNION</codeph> clause allows the results
of two queries to be combined. The second query is surrounded
by parentheses.
</p>
<codeblock>select * from java.lang.String union (select * from java.lang.StringBuilder)</codeblock>
<p>The two queries must match in the number of columns in the select clause.</p>
<codeblock>SELECT s, s.value, s.hash FROM java.lang.String s UNION (SELECT b, b.value, "dummy" FROM java.lang.StringBuilder b )</codeblock>
</section>
</refbody>
</reference>