AND

All functions > LOGICAL > AND

Returns TRUE when both boolean operands are TRUE.

Syntax

expr1 AND expr2  ·  AND(expr1, expr2)

Notes

  • Chains as nested binary AND: a AND b AND c groups as (a AND b) AND c
  • AND binds tighter than OR — mix them with parentheses when in doubt
  • Three-valued logic: FALSE with NULL yields FALSE; TRUE with NULL yields NULL; both NULL yields NULL

Related Functions

Examples

expr1 AND expr2

FeatureQL
SELECT
    f1 := TRUE AND TRUE, -- Infix both true
    f2 := TRUE AND FALSE, -- Infix one false
    f3 := FALSE AND NULL::BOOLEAN -- Infix FALSE absorbs NULL
;
Result
f1 BOOLEANf2 BOOLEANf3 BOOLEAN
truefalsefalse

Last update at: 2026/05/26 17:22:09