ARRAY_DISTINCT
Description
The ARRAY_DISTINCT
function is used to remove duplicate elements from an array, returning an array without duplicates. This function can handle arrays of any type, including integers, floating-point numbers, strings, etc.
Syntax
Parameter Description
array
:array<T>
type, represents the array that needs to be deduplicated.
Return Result
Returns a result of type array<T>
, which contains the deduplicated array elements.
Usage Example
- Remove duplicates from an integer array:
- Remove duplicates from an array of floating-point numbers:
- Remove duplicates from a string array:
- Remove duplicates from a mixed-type array:
Notes
- When the array is empty, the
ARRAY_DISTINCT
function will return an empty array.