Java Persistence API (JPA) Extensions Reference for EclipseLink, Release 2.5
  Go To Table Of Contents
 Search
 PDFComments
Comments


INTERSECT

When performing multiple queries, use INTERSECT to return only results that are found in both queries.


Examples

Example 3-8 shows how to use this JPQL extension.

Example 3-8 Using INTERSECT EQL

SELECT e FROM Employee e JOIN e.phones p WHERE p.areaCode = :areaCode1
INTERSECT SELECT e FROM Employee e JOIN e.phones p WHERE p.areaCode = :areaCode2


See Also

For more information, see: