OVERLAPS (Entity SQL)
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
true if the two collections have common elements; otherwise,
OVERLAPS provides functionally equivalent to the 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:
Follow the procedure in How to: Execute a Query that Returns StructuralType Results.
Pass the following query as an argument to the
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))