true如果两个表达式均为 true,则返回;否则 falseNULL返回 。
语法
boolean_expression AND boolean_expression
或
boolean_expression && boolean_expression
论据
boolean_expression
返回布尔值的任何有效表达式。
注解
双和(&&)具有与 AND 运算符相同的功能。
以下矩阵显示了可能的输入值组合和返回值。
TRUE |
FALSE |
NULL |
|
|---|---|---|---|
TRUE |
TRUE | FALSE | Null |
FALSE |
FALSE | FALSE | FALSE |
NULL |
Null | FALSE | Null |
示例:
以下 Entity SQL 查询演示如何使用 AND 运算符。 查询基于 AdventureWorks 销售模型。 若要编译并运行此查询,请执行以下步骤:
按照作方法中的过程作 :执行返回 StructuralType 结果的查询。
将以下查询作为参数传递给
ExecuteStructuralTypeQuery方法:
-- AND
SELECT VALUE product FROM AdventureWorksEntities.Products
AS product where product.ListPrice > @price1 AND product.ListPrice < @price2
-- &&
SELECT VALUE product FROM AdventureWorksEntities.Products
AS product where product.ListPrice > @price1 && product.ListPrice < @price2