Skip to main content

[ NOT ] BETWEEN

Returns true if the given numeric or string <expr> falls inside the defined lower and upper limits.

Syntax

<expr> [ NOT ] BETWEEN <lower_limit> AND <upper_limit>

Examples

SELECT 'true' WHERE 5 BETWEEN 0 AND 5;

┌────────┐
'true'
├────────┤
true
└────────┘

SELECT 'true' WHERE 'data' BETWEEN 'data' AND 'databendcloud';

┌────────┐
'true'
├────────┤
true
└────────┘
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today