Categories:

Data Generation Functions

# UNIFORM¶

Returns a uniformly random number, in the inclusive range [`min`, `max`].

## Syntax¶

```UNIFORM( <min> , <max> , <gen> )
```

## Usage Notes¶

• `min` and `max` must be constants.

• If `min` or `max`, or both, are floating point numbers, the generated numbers are floating point. If both `min` and `max` are integers, the generated numbers are integers as well.

• `gen` specifies the generator expression for the function. For more information, see Usage Notes.

## Examples¶

```SELECT uniform(1, 10, random()) FROM table(generator(rowCount => 5));

--------------------------+
uniform(1, 10, random()) |
--------------------------+
6                        |
4                        |
7                        |
9                        |
4                        |
--------------------------+
```
```SELECT uniform(0::float, 1::float, random()) FROM table(generator(rowCount => 5));

---------------------------------------+
uniform(0::float, 1::float, random()) |
---------------------------------------+
0.2895427479                          |
0.7178660941                          |
0.6925603163                          |
0.05914526824                         |
0.8243151404                          |
---------------------------------------+
```
```SELECT uniform(1, 10, 1234) FROM table(generator(rowCount => 5));

----------------------+
uniform(1, 10, 1234) |
----------------------+
7                    |
7                    |
7                    |
7                    |
7                    |
----------------------+
```