Logical OR (OR( || )) : OR : Logic Operator MySQL TUTORIALS


MySQL TUTORIALS » Logic Operator » OR »

 

Logical OR (OR( || ))


When both operands are non-NULL, the result is 1 if any operand is non-zero, and 0 otherwise.

With a NULL operand, the result is 1 if the other operand is non-zero, and NULL otherwise.

If both operands are NULL, the result is NULL.

mysql>
mysql> SELECT || 1;
+--------+
|| |
+--------+
|      |
+--------+
row in set (0.00 sec)

mysql> SELECT || 0;
+--------+
|| |
+--------+
|      |
+--------+
row in set (0.00 sec)

mysql> SELECT || 0;
+--------+
|| |
+--------+
|      |
+--------+
row in set (0.00 sec)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Logic Operator
» OR