> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Calculates the list of distinct data types stored in Dynamic column.

# distinctDynamicTypes

<h2 id="distinctDynamicTypes">
  distinctDynamicTypes
</h2>

Introduced in: v24.9.0

Calculates the list of distinct data types stored in [Dynamic](/reference/data-types/dynamic) column.

**Syntax**

```sql theme={null}
distinctDynamicTypes(dynamic)
```

**Arguments**

* `dynamic` — Dynamic column. [`Dynamic`](/reference/data-types/dynamic)

**Returned value**

Returns the sorted list of data type names. [`Array(String)`](/reference/data-types/array)

**Examples**

**Basic usage with mixed types**

```sql title=Query theme={null}
DROP TABLE IF EXISTS test_dynamic;
CREATE TABLE test_dynamic(d Dynamic) ENGINE = Memory;
INSERT INTO test_dynamic VALUES (42), (NULL), ('Hello'), ([1, 2, 3]), ('2020-01-01'), (map(1, 2)), (43), ([4, 5]), (NULL), ('World'), (map(3, 4));

SELECT distinctDynamicTypes(d) FROM test_dynamic;
```

```response title=Response theme={null}
┌─distinctDynamicTypes(d)──────────────────────────────────────────┐
│ ['Array(Int64)', 'Date', 'Int64', 'Map(UInt8, UInt8)', 'String'] │
└──────────────────────────────────────────────────────────────────┘
```
