| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE html |
| PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us"> |
| <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| |
| <meta name="generator" content="DITA-OT" /><meta name="DC.type" content="reference" /> |
| <meta name="DC.title" content="UNION Clause" /> |
| <meta name="abstract" content="" /> |
| <meta name="description" content="" /> |
| <meta name="DC.relation" scheme="URI" content="../reference/oqlsyntax.html" /> |
| <meta name="copyright" content="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/ " type="primary" /> |
| <meta name="DC.rights.owner" content="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/ " type="primary" /> |
| <meta name="DC.format" content="XHTML" /> |
| <meta name="DC.identifier" content="ref_oqlsyntaxunion" /> |
| <meta name="DC.language" content="en-us" /> |
| <link rel="stylesheet" type="text/css" href="../styles/commonltr.css" /> |
| <title>UNION Clause</title> |
| </head> |
| <body id="ref_oqlsyntaxunion"> |
| |
| <h1 class="title topictitle1" id="ariaid-title1">UNION Clause</h1> |
| |
| |
| |
| |
| |
| <div class="body refbody"><p class="shortdesc"></p> |
| |
| <div class="section"> |
| <p class="p"> |
| The <code class="ph codeph">UNION</code> clause allows the results |
| of two queries to be combined. The second query is surrounded |
| by parentheses. |
| </p> |
| |
| <pre class="pre codeblock"><code>select * from java.lang.String union (select * from java.lang.StringBuilder)</code></pre> |
| <p class="p">The two queries must match in the number of columns in the select clause.</p> |
| |
| <pre class="pre codeblock"><code>SELECT s, s.value, s.hash FROM java.lang.String s UNION (SELECT b, b.value, "dummy" FROM java.lang.StringBuilder b )</code></pre> |
| </div> |
| |
| </div> |
| |
| <div class="related-links"> |
| <div class="familylinks"> |
| <div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../reference/oqlsyntax.html">OQL Syntax</a></div> |
| </div> |
| </div></body> |
| </html> |