IS NOT NULL

All functions > COMPARISON > IS NOT NULL

Returns TRUE if the expression does NOT evaluate to NULL.

Syntax

expr IS NOT NULL [:: type]

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; optional ::T after the keywords disambiguates the expression when its type would otherwise be unclear (for example EMPTY from an unmatched RELATED); when ::T is present it must match the expression type
  • Never returns NULL itself - always Returns TRUE or FALSE

Related Functions

Examples

IS NOT NULL — detection

FeatureQL
SELECT
    f1 := 'x' IS NOT NULL::VARCHAR, -- Non-NULL string
    f2 := NULL::VARCHAR IS NOT NULL::VARCHAR -- NULL is not non-NULL
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

IS NOT NULL — composite values

FeatureQL
SELECT
    f1 := ARRAY(1, 2) IS NOT NULL::ARRAY(BIGINT) -- Non-NULL array
;
Result
f1 BOOLEAN
true

IS NOT NULL — contrast with !=

FeatureQL
SELECT
    f1 := NULL::BIGINT != NULL::BIGINT -- `!=` does not behave like IS NOT NULL
;
Result
f1 BOOLEAN
NULL

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