|| (OR) (Entity SQL)


Combines two Boolean expressions.

boolean_expression OR boolean_expression  
boolean_expression || boolean_expression  

Any valid expression that returns a Boolean.

true when either of the conditions is true; otherwise, false.

OR is an Entity SQL logical operator. It is used to combine two conditions. When more than one logical operator is used in a statement, OR operators are evaluated after AND operators. However, you can change the order of evaluation by using parentheses.

Double vertical bars (||) have the same functionality as the OR operator.

The following table shows possible input values and return types.


The following Entity SQL query uses the OR operator to combine two Boolean expressions. The query is based on the AdventureWorks Sales Model. To compile and run this query, 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:

[!CODE [DP EntityServices Concepts 2#OR](../CodeSnippet/VS_Snippets_Data/dp entityservices concepts 2#or)]

Entity SQL Reference