# CONNECTION\_ID

Returns the unique connection ID of the current connection.

The ID returned by the function will only be unique in the context of a single (child) aggregator, so it cannot be used to uniquely identify sessions cluster-wide.

## Syntax

```sql
CONNECTION_ID()

```

## Return Type

Integer.

## Example

```sql
SELECT CONNECTION_ID();

```

```output

+-----------------+
| CONNECTION_ID() |
+-----------------+
|             171 |
+-----------------+

```

***

Modified at: November 8, 2023

Source: [/db/v9.1/reference/sql-reference/information-functions/connection-id/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/information-functions/connection-id/)

(An index of the documentation is available at /llms.txt)
