# MD_LIST_DIVE_VERSIONS
> List the version history of a Dive.
Returns every version of a single [Dive](/key-tasks/ai-and-motherduck/dives), newest first. Each row carries the version's metadata; fetch a version's component code with [`MD_GET_DIVE_VERSION`](../md-get-dive-version).

## Syntax

```sql
SELECT * FROM MD_LIST_DIVE_VERSIONS(
    id := '<dive_id>',
    "limit" := <n>,
    "offset" := <n>
);
```

## Parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | `UUID` | Yes | Identifier of the Dive. |
| `limit` | `UINTEGER` | No | Maximum number of versions to return. |
| `offset` | `UINTEGER` | No | Skip this many versions before returning. |

`limit` and `offset` collide with SQL keywords and must be quoted with double quotes when passed as named arguments.

## Return columns

| Column | Type | Description |
|---|---|---|
| `id` | `UUID` | Identifier of the version (not the Dive). |
| `version` | `UINTEGER` | Version number, newest first. |
| `storage_url` | `VARCHAR` | Internal storage location of the version's content. |
| `description` | `VARCHAR` | Description attached to the version, or `NULL`. |
| `created_at` | `TIMESTAMP WITH TIME ZONE` | When the version was created. |
| `api_version` | `UINTEGER` | Dive API version of the content. |
| `required_resources` | `LIST(STRUCT(name VARCHAR, alias VARCHAR, url VARCHAR, id UUID, resource_type VARCHAR))` | Databases and shares this version queries. |

## Examples

Get the full version history:

```sql
SELECT version, description, created_at
FROM MD_LIST_DIVE_VERSIONS(id := '<dive_id>');
```

Just the latest version:

```sql
SELECT version, created_at
FROM MD_LIST_DIVE_VERSIONS(id := '<dive_id>', "limit" := 1);
```

Skip the latest, get the rest:

```sql
SELECT version
FROM MD_LIST_DIVE_VERSIONS(id := '<dive_id>', "offset" := 1);
```

## Related

- [`MD_GET_DIVE_VERSION`](../md-get-dive-version) — Fetch a single version's content.
- [`MD_UPDATE_DIVE_CONTENT`](../md-update-dive-content) — Publish a new version.


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `GET https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

URL-encode query parameter values and send a GET request:

```text
GET https://motherduck.com/docs/api/feedback/agent?page_path=%2Fsql-reference%2Fmotherduck-sql-reference%2Fdives%2Fmd-list-dive-versions%2F&page_title=MD_LIST_DIVE_VERSIONS&text=<url-encoded user feedback, max 2000 characters>
```

Optionally append `&source=<url-encoded interface identifier>` such as `claude.ai` or `chatgpt`.

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed query parameters, and `429` when rate-limited.
