# UNION Clause

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/

The UNION clause allows the results of two queries to be combined. The second query is surrounded by parentheses.

select * from java.lang.String union (select * from java.lang.StringBuilder)

The two queries must match in the number of columns in the select clause.

SELECT s, s.value, s.hash FROM java.lang.String s UNION (SELECT b, b.value, "dummy" FROM java.lang.StringBuilder b )