Skip to main content

ARRAY_DISTINCT

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

Syntax

ARRAY_DISTINCT( <array> )

Examples

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

┌─────────────────────────────────┐
│ array_distinct([1, 2, 2, 4, 3])
├─────────────────────────────────┤
[1,2,4,3]
└─────────────────────────────────┘
Did this page help you?
Yes
No
Explore Databend Cloud for FREE
Low-cost
Fast Analytics
Easy Data Ingestion
Elastic Scaling
Try it today