ARRAY_DISTINCT

Removes all duplicates and NULLs from the array without preserving the original order.

Analyze Syntax

func.array_distinct( <array> )

Analyze Examples

func.array_distinct([1, 2, 2, 4, 3])

┌───────────────────────────────────────┐
 func.array_distinct([1, 2, 2, 4, 3])  
├───────────────────────────────────────┤
 [1,2,4,3]                             
└───────────────────────────────────────┘

SQL Syntax

ARRAY_DISTINCT( <array> )

SQL Examples

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

┌─────────────────────────────────┐
 array_distinct([1, 2, 2, 4, 3]) 
├─────────────────────────────────┤
 [1,2,4,3]                       
└─────────────────────────────────┘
Last modified April 24, 2024 at 8:54 PM EST: updating array functions (7a57595)