!= [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 BOOLEAN | f2 BOOLEAN | f3 BOOLEAN |
|---|---|---|
| true | true | false |
!= — 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 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | false |
!= — three-valued logic
FeatureQL
SELECT
-- NULL on the left
f1 := NULL::BIGINT != 1,
-- NULL vs NULL
f2 := NULL::BIGINT != NULL::BIGINT
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| NULL | NULL |