Go to the first, previous, next, last section, table of contents.


Logical operations.

All logical function return 1 (TRUE) or 0 (FALSE).

NOT
!
Logical NOT. Return 1 if argument is 0 else return 0.
mysql> select NOT 1;                    ->      0
mysql> select NOT NULL;                 ->      NULL
mysql> select ! (1+1);                  ->      0
mysql> select ! 1+1;                    ->      1
OR
||
Logical OR. Return 1 if any of the arguments are non 0 and not NULL.
mysql> select 1 || 0;                   ->      1
mysql> select 0 || 0;                   ->      0
mysql> select 1 || NULL;                ->      1

AND
&&
Logical AND. Return 1 if all of the arguments are non 0 or NULL
mysql> select 1 && NULL;                ->      0
mysql> select 1 && 0;                   ->      0


Go to the first, previous, next, last section, table of contents.