---
title: monotonically_increasing_id function
description: Learn the syntax of the monotonically\_increasing\_id function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/monotonically_increasing_id
---

# `monotonically_increasing_id` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

Returns monotonically increasing 64-bit integers.

## Syntax

```
monotonically_increasing_id()
```

## Arguments

This function takes no arguments.

## Returns

A `BIGINT`.

The generated ID is guaranteed to be monotonically increasing and unique, but not consecutive.
The function is non-deterministic, so it may return different values if called multiple times for the same row.

## Examples

```sql
> SELECT monotonically_increasing_id();
 0
```

## Related functions

* [`uuid` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/uuid.md)
