Logical Operators

Logical operators are used for evaluating values or expressions for true, false, or unknown. Table B-3 lists allowable logical operators.

Table B-3. Logical operators

Operator

Use

AND

Logical AND

&&

Logical AND

IS boolean

Logical equal

IS NOT boolean

Logical equal

OR

Logical OR

||

Logical OR

NOT

Logical NOT

!

Logical NOT

XOR

Logical XOR

The operators IS and IS NOT are being added in Version 5.0.2 of MySQL. A boolean value of TRUE, FALSE, or UNKNOWN should immediately follow these operators.

Get MySQL in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.