Postgresql 中文操作指南
9.1. Logical Operators #
可以使用通常的逻辑运算符:
The usual logical operators are available:
boolean AND boolean → boolean
boolean OR boolean → boolean
NOT boolean → boolean
SQL 使用三值逻辑系统,包括真、假和 null,表示“未知”。请观察以下真值表:
SQL uses a three-valued logic system with true, false, and null, which represents “unknown”. Observe the following truth tables:
运算符 AND 和 OR 是可交换的,也就是说,你可以在不影响结果的情况下切换左操作数和右操作数。(但是,无法保证左操作数会在右操作数之前求值。有关子表达式的求值顺序的详细信息,请参见 Section 4.2.14。)
The operators AND and OR are commutative, that is, you can switch the left and right operands without affecting the result. (However, it is not guaranteed that the left operand is evaluated before the right operand. See Section 4.2.14 for more information about the order of evaluation of subexpressions.)