📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

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 'datalakecloud'; ┌────────┐ │ 'true' │ ├────────┤ │ true │ └────────┘

Was this page helpful?