IS_NOT_NULL()

All functions > COMPARISON > IS_NOT_NULL()

Returns TRUE if the expression does NOT evaluate to NULL.

Signatures

Returns: TRUE or FALSE; these predicates do not return NULL themselves

IS_NOT_NULL(expr: T) → BOOLEAN
sql
ParameterTypeRequiredDescription
exprTYesExpression that may be NULL

Notes

  • Opposite of IS NULL
  • Only reliable way to test for non-NULL values
  • Using != NULL always returns NULL, not TRUE/FALSE
  • Works with any data type (scalars, ARRAY, ROW, etc.); optional ::type after the keyword must match the expression type when present
  • Never returns NULL itself - always Returns TRUE or FALSE

Related operators

Examples

IS_NOT_NULL — functional call (second arg is TYPE '…')

FeatureQL
SELECT
    f1 := IS_NOT_NULL('x', TYPE 'VARCHAR'), -- Non-NULL string
    f2 := IS_NOT_NULL(NULL::BIGINT, TYPE 'BIGINT') -- NULL is not non-NULL
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

IS_NOT_NULL — chained

FeatureQL
SELECT
    f1 := ('x').IS_NOT_NULL(TYPE 'VARCHAR'), -- Dot form: receiver is the expression under test
    f2 := (NULL::BIGINT).IS_NOT_NULL(TYPE 'BIGINT') -- Same semantics as the prefix call
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

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