---
title: "RANDOM"
description: "The RANDOM SQL function generates a random number between 0 and 1."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/random
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/random
updated: 2026-08-09T00:00:00Z
license: https://documentation.invantive.eu/en/
---

## Syntax
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> RANDOM[RANDOM]:::quoted
    RANDOM --> End((END))
```

## Purpose
The `RANDOM` SQL function generates a random number between 0 and 1.

See also [[RAND]], [[RANDOM_BLOB]] and [[RANDOM_TEXT]].

Parameters:
- Seed (optional, `int32`): Produce a repeatable sequence of random numbers each time that seed value is provided.

Returns: A random number between 0 and 1.

## Examples
The following example generates a random number between 0 and 1; the actual value differs per invocation:
```sql
select random()

-------------------
0.443596436
```
The following example generates a random number between 0 and 1 using a seed:
```sql
select random(5)

-------------------
0.397313961
```