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 cgroups 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 BOOLEAN | f2 BOOLEAN | f3 BOOLEAN |
|---|---|---|
| true | false | false |
On this page