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

# uuid_version()

> Extract the version of a UUID

<Icon icon="tag" iconType="duotone" /> Since [2.23.0][tsdb-2.23.0]

Extract the version number from a UUID object:

![UUIDv7][uuidv7]

## Samples

```sql theme={"dark"}
SELECT uuid_version('019913ce-f124-7835-96c7-a2df691caa98');
```

Returns something like:

```terminaloutput theme={"dark"}
 uuid_version
--------------
            7
```

## Arguments

The syntax is:

```sql theme={"dark"}
SELECT uuid_version(
    uuid = <uuid>
);
```

| Name   | Type | Default | Required | Description                                        |
| ------ | ---- | ------- | -------- | -------------------------------------------------- |
| `uuid` | UUID | -       | ✔        | The UUID object to extract the version number from |

## Returns

| Column         | Type    | Description                                                             |
| -------------- | ------- | ----------------------------------------------------------------------- |
| `uuid_version` | INTEGER | The version number extracted from the UUID object (e.g., 7 for UUIDv7). |

[tsdb-2.23.0]: https://github.com/timescale/timescaledb/releases/tag/2.23.0

[uuidv7]: https://assets.timescale.com/docs/images/uuidv7-structure.svg
