> For the complete documentation index, see [llms.txt](https://upsolver.gitbook.io/content/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://upsolver.gitbook.io/content/reference-1/functions-and-operators/functions/mathematical/rand.md).

# RAND

Returns a pseudo-random value in the range 0.0 <= x < 1.0.

This is an alias for the [`RANDOM`](/content/reference-1/functions-and-operators/functions/mathematical/random.md) function.

## Syntax

```sql
RAND()
```

## Returns

type: `double`

A pseudo-random value in the range 0.0 <= x < 1.0

The value will not change between different runs of the same task, i.e. if the result of this function makes the task fail, it will consistently fail.

***

## Examples

### Transformation job example

#### SQL

```sql
CREATE JOB function_operator_example
    ADD_MISSING_COLUMNS = true	
AS INSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data 
  MAP_COLUMNS_BY_NAME
    SELECT RAND() as random_value
    FROM default_glue_catalog.upsolver_samples.orders_raw_data 
    WHERE $commit_time BETWEEN run_start_time() AND run_end_time()
    LIMIT 5;
```

#### Query result

| random\_value       |
| ------------------- |
| 0.7221127479457028  |
| 0.2188878339486462  |
| 0.2127962883398693  |
| 0.12963758700859804 |
| 0.52354605630098234 |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://upsolver.gitbook.io/content/reference-1/functions-and-operators/functions/mathematical/rand.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
