!= [not]

All functions > COMPARISON > != [not]

Returns TRUE if the first value does not equal the second value

Syntax

expr1 != expr2

Notes

  • Both values must be of the same or compatible types
  • NULL comparisons always return NULL (three-valued logic)
  • For strings, performs case-sensitive comparison
  • For numeric types, supports optional decimal precision
  • For ARRAY and ROW, same structural rules as =
  • Opposite of equals (=)

Related Functions

Examples

!= — inequality

FeatureQL
SELECT
    -- Different numbers
    f1 := 1 != 2,
    -- Different strings
    f2 := 'a' != 'b',
    -- Same value
    f3 := 3 != 3
;
Result
f1 BOOLEANf2 BOOLEANf3 BOOLEAN
truetruefalse

!= — arrays and rows

FeatureQL
SELECT
    -- Different lengths / elements
    f1 := ARRAY(1, 2) != ARRAY(1., 2., 3.),
    -- Same values under alignment
    f2 := ARRAY(1, 2) != ARRAY(1., 2.)
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

!= — three-valued logic

FeatureQL
SELECT
    -- NULL on the left
    f1 := NULL::BIGINT != 1,
    -- NULL vs NULL
    f2 := NULL::BIGINT != NULL::BIGINT
;
Result
f1 BOOLEANf2 BOOLEAN
NULLNULL

Last update at: 2026/06/20 10:08:10