expr NOT BETWEEN min AND max
This is the same as NOT (expr BETWEEN min AND max).
Note that the meaning of the alternative form NOT expr BETWEEN min AND max
is affected by the HIGH_NOT_PRECEDENCE
SQL_MODE flag.
SELECT 1 NOT BETWEEN 2 AND 3; +-----------------------+ | 1 NOT BETWEEN 2 AND 3 | +-----------------------+ | 1 | +-----------------------+
SELECT 'b' NOT BETWEEN 'a' AND 'c'; +-----------------------------+ | 'b' NOT BETWEEN 'a' AND 'c' | +-----------------------------+ | 0 | +-----------------------------+
NULL:
SELECT 1 NOT BETWEEN 1 AND NULL; +--------------------------+ | 1 NOT BETWEEN 1 AND NULL | +--------------------------+ | NULL | +--------------------------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/not-between/