> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

> Reference material for ARRAY_DISTINCT function

# ARRAY_DISTINCT

Returns an array containing only the *unique* elements of the given array. If the given array contains multiple identical members, the returned array will include only a single member of that value. NULL is considered a value like any other, meaning that if the array contains one or more NULLs, the returned array will contain NULL.

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
ARRAY_DISTINCT(<array>)
```

## Parameters

| Parameter | Description                  | Supported input types |
| :-------- | :--------------------------- | :-------------------- |
| `<array>` | The array to be deduplicated | `ARRAY`               |

## Return Type

`ARRAY` of the same type as the input array

## Example

In the following example, the unique levels of the game are returned in an array called `levels`:

<div className="query-window">
  ```
  SELECT ARRAY_DISTINCT([1, 1, 2, 2, 3, 4, 1, NULL, 2, NULL]) AS levels;
  ```

  | levels <span>array(int null)</span> |
  | :---------------------------------- |
  | \[1, 2, 3, 4, NULL]                 |

  <p><span>Rows: 1</span><span>Execution time: 6.73ms</span></p>
</div>
