Export (0) Print
Expand All


Determines whether two collections have common elements.

expression OVERLAPS expression

Any valid query expression that returns a collection to compare with the collection returned from another query expression. All expressions must be of the same type or of a common base or derived type as expression.

true if the two collections have common elements; otherwise, false.

OVERLAPS provides functionally equivalent tothe following:

EXISTS ( expression INTERSECT expression )

OVERLAPS is one of the Entity SQL set operators. All Entity SQL set operators are evaluated from left to right. For precedence information for the Entity SQL set operators, see EXCEPT.

The following Entity SQL query uses the OVERLAPS operator to determines whether two collections have a common value. The query is based on the AdventureWorks Sales Model. To compile and run this, follow these steps:

  1. Follow the procedure in How to: Execute a Query that Returns StructuralType Results.

  2. Pass the following query as an argument to the ExecuteStructuralTypeQuery method:

SELECT value P from AdventureWorksEntities.Products
as P WHERE ((select P from AdventureWorksEntities.Products
as P WHERE P.ListPrice > @price1) overlaps (select P from
AdventureWorksEntities.Products as P WHERE P.ListPrice < @price2))

Build Date:

© 2015 Microsoft