The usual logical operators are available: 通常の論理演算子が使用できます。
booleanANDboolean→booleanbooleanORboolean→booleanNOTboolean→boolean
<acronym>SQL</acronym> uses a three-valued logic system with true,
false, and <literal>null</literal>, which represents <quote>unknown</quote>.
Observe the following truth tables:
SQLはtrue、false、そして「不明」を意味するnullの3値の論理システムを使用します。
以下の真理値表を参照してください。
a | b | a AND b | a OR b |
|---|---|---|---|
| TRUE | TRUE | TRUE | TRUE |
| TRUE | FALSE | FALSE | TRUE |
| TRUE | NULL | NULL | TRUE |
| FALSE | FALSE | FALSE | FALSE |
| FALSE | NULL | FALSE | NULL |
| NULL | NULL | NULL | NULL |
a | NOT a |
|---|---|
| TRUE | FALSE |
| FALSE | TRUE |
| NULL | NULL |
The operators <literal>AND</literal> and <literal>OR</literal> 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 <xref
linkend="syntax-express-eval"/> for more information about the
order of evaluation of subexpressions.)
AND演算子とOR演算子は可換です。
つまり、結果に影響を与えることなく左右のオペランドを交換することができます。
(しかし、左オペランドが右オペランドよりも先に評価されるという保証はありません。副式の評価順についてのより詳細は4.2.14を参照してください。)