You cannot use a UNION operation in a subquery expression. To use a union query in a subquery, first create the union query and save it as a named query. Then include the name of the saved query in your subquery expression.