ARRAY_UNIQUE
All functions > ARRAY > ARRAY_UNIQUE
Returns an array with unique elements, removing all duplicates.
Syntax
ARRAY_UNIQUE(array)
sql
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
array | ARRAYBIGINT | Yes | The input array containing possible duplicate elements |
Returns
An array with only unique elements, duplicates removed
Notes
- Removes all duplicate elements from the array
- Returns only distinct values
- Order may be preserved or sorted depending on implementation
- Converts a multi-set (bag) into a set
- Empty arrays remain empty