diff --git a/content/influxdb/cloud-iox/reference/sql/functions/math.md b/content/influxdb/cloud-iox/reference/sql/functions/math.md index 2ad933587..a65efdae9 100644 --- a/content/influxdb/cloud-iox/reference/sql/functions/math.md +++ b/content/influxdb/cloud-iox/reference/sql/functions/math.md @@ -26,6 +26,7 @@ performing mathematic operations: - [log10](#log10) - [log2](#log2) - [power](#power) +- [random](#random) - [round](#round) - [signum](#signum) - [sin](#sin) @@ -438,6 +439,38 @@ SELECT power(temp, hum * .1) AS power FROM home LIMIT 3 {{% /expand %}} {{< /expand-wrapper >}} +## random + +Returns a random float value. +The random seed is unique to each row. + +```sql +random() +``` + +{{< expand-wrapper >}} +{{% expand "View `random` query example" %}} + +_The following example uses the sample data set provided in +[Get started with InfluxDB tutorial](/influxdb/cloud-iox/get-started/write/#construct-line-protocol)._ + +```sql +SELECT temp * random() AS random FROM home LIMIT 3 +``` + +{{% note %}} +Due to the nature of the function, your results will not match the results below. +{{% /note %}} + +| random | +| -----------------: | +| 0.5030770374815072 | +| 12.938847036567514 | +| 2.8204596545385385 | + +{{% /expand %}} +{{< /expand-wrapper >}} + ## round Rounds a number to the nearest integer.