> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RANGE

> Generates an exclusive-end sequence of BIGINT values.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Table function</span></div>

Use non-NULL literal endpoints. The generated id values are not NULL.

## Syntax

### Table

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
RANGE(end)
```

### Start end (table)

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
RANGE(start, end)
```

### Step (table)

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
RANGE(start, end, step)
```

* INLINE\_TABLE\_FUNCTIONS=true

### With numParts (table)

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
RANGE(start, end, step, numParts)
```

* INLINE\_TABLE\_FUNCTIONS=true

## Arguments

### Table

| Name | Type | Required | Description |
| - | - | - | - |
| end | BIGINT numeric literal | Yes | Exclusive upper endpoint. Must be a constant argument. |

### Start end

| Name | Type | Required | Description |
| - | - | - | - |
| start | BIGINT numeric literal | Yes | Inclusive starting value. Must be a constant argument. |
| end | BIGINT numeric literal | Yes | Exclusive endpoint. Must be a constant argument. |

### Step

| Name | Type | Required | Description |
| - | - | - | - |
| start | BIGINT numeric literal | Yes | Inclusive start. Must be a constant argument. |
| end | BIGINT numeric literal | Yes | Exclusive endpoint. Must be a constant argument. |
| step | nonzero BIGINT numeric literal | Yes | Increment; may be negative. Must be a constant argument. |

### With numParts

| Name | Type | Required | Description |
| - | - | - | - |
| start | BIGINT numeric literal | Yes | Inclusive start. Must be a constant argument. |
| end | BIGINT numeric literal | Yes | Exclusive endpoint. Must be a constant argument. |
| step | nonzero BIGINT numeric literal | Yes | Increment. Must be a constant argument. |
| numParts | INTEGER numeric literal | Yes | Accepted but has no effect on the generated values or how the work is divided. Must be a constant argument. |

## Returns

* Type: TABLE\<id:BIGINT>
* NULL behavior: Use non-NULL literal endpoints. The generated id values are not NULL.
* Empty input: A range whose step points away from its endpoint emits no rows.
* Shape: A table with one BIGINT column named id; end is excluded.
* Ordering: Values follow the requested step logically; use ORDER BY id for guaranteed SQL result order.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | Yes |

## Usage notes

* RANGE(end) starts at 0; RANGE(start,end) uses a default step of 1.
* The three- and four-argument RANGE forms require INLINE\_TABLE\_FUNCTIONS=true. When this setting is false, only the one- and two-argument forms with literal values are supported.
* Bounds must be literals. numParts is accepted but has no effect on how the generated rows are divided for processing.
* Deterministic: The same inputs and settings produce the same result.

## Examples

### Typical behavior

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT id FROM RANGE(3) ORDER BY id;
```

| id |
| - |
| 0 |
| 1 |
| 2 |

### Choose a start, stop and step

The stop value is excluded.

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT id FROM range(2, 9, 3) ORDER BY id;
```

| id |
| - |
| 2 |
| 5 |
| 8 |

## Limitations

* step cannot be zero.
* Use literal arguments; huge ranges can consume substantial planning memory, and fixed-width endpoint arithmetic has finite bounds.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.