Java Persistence API (JPA) Extensions Reference for EclipseLink, Release 2.4
UNION to combine the results of two queries into a single query.
UNION, the unique results from both queries will be returned. If you include the
ALL option, the results found in both queries will be duplicated.
Example 3-15 shows how to use this JPQL extension.
Example 3-15 Using UNION EQL
SELECT MAX(e.salary) FROM Employee e WHERE e.address.city = :city1 UNION SELECT MAX(e.salary) FROM Employee e WHERE e.address.city = :city2
For more information, see: