v.19.3New Features

Implemented NOT BETWEEN Comparison Operator

Implemented NOT BETWEEN comparison operator. #4228 (Dmitry Naumov)
Introduced the NOT BETWEEN comparison operator in ClickHouse SQL, allowing expressions to test if a value is outside a specified range.

Why it matters

This feature addresses the need to efficiently filter data where values lie outside a given range, improving query expressiveness and readability by providing a direct operator instead of negating BETWEEN conditions.

How to use it

Use the NOT BETWEEN operator in WHERE clauses or conditional expressions as follows:
SELECT * FROM table WHERE column NOT BETWEEN lower_bound AND upper_bound;