Link Search Menu Expand Document

ARRAY_DISTINCT

Returns an array containing only the unique elements of the given array. In other words, if the given array contains multiple identical members, the returned array will include only a single member of that value.

Syntax

ARRAY_DISTINCT(<arr>)
Parameter Description
<arr> The array to be analyzed for unique members.

Example

SELECT
	ARRAY_DISTINCT([ 1, 1, 2, 2, 3, 4 ]) AS res;

Returns: 1,2,3,4