!= [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
f1 := 1 != 2, -- Different numbers
f2 := 'a' != 'b', -- Different strings
f3 := 3 != 3 -- Same value
;Result
| f1 BOOLEAN | f2 BOOLEAN | f3 BOOLEAN |
|---|---|---|
| true | true | false |
!= — arrays and rows
FeatureQL
SELECT
f1 := ARRAY(1, 2) != ARRAY(1., 2., 3.), -- Different lengths / elements
f2 := ARRAY(1, 2) != ARRAY(1., 2.) -- Same values under alignment
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | false |
!= — three-valued logic
FeatureQL
SELECT
f1 := NULL::BIGINT != 1, -- NULL on the left
f2 := NULL::BIGINT != NULL::BIGINT -- NULL vs NULL
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| NULL | NULL |