When performing multiple queries, use EXCEPT
to remove the results of a second query from the results of a first query.
The EXCEPT
function is database independent, but requires database support.
Example 3-4 shows how to use this JPQL extension.
SELECT e FROM Employee e EXCEPT SELECT e FROM Employee e WHERE e.salary > e.manager.salary
For more information, see: