top of page
MySQL:
OR
Syntax:
OR, ||
Logical OR. When both operands are non-NULL, the result is 1 if any
operand is nonzero, and 0 otherwise. With a NULL operand, the result is
1 if the other operand is nonzero, and NULL otherwise. If both operands
are NULL, the result is NULL.
Example
mysql> SELECT 1 OR 1;
-> 1
mysql> SELECT 1 OR 0;
-> 1
mysql> SELECT 0 OR 0;
-> 0
mysql> SELECT 0 OR NULL;
-> NULL
mysql> SELECT 1 OR NULL;
-> 1
bottom of page