fix(cloud-iox): update tutorial examples to use tutorial sample data. (#4826)
parent
e5c9c0489d
commit
a9e0e2128e
|
@ -33,7 +33,7 @@ This tutorial walks you through the fundamentals of querying data in InfluxDB an
|
||||||
[Query data in InfluxDB](/influxdb/cloud-iox/query-data/). -->
|
[Query data in InfluxDB](/influxdb/cloud-iox/query-data/). -->
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
The examples in this section of the tutorial query the data from written in the
|
The examples in this section of the tutorial query the [**get-started** bucket](/influxdb/cloud-iox/get-started/setup/) for data written in the
|
||||||
[Get started writing data](/influxdb/cloud-iox/get-started/write/#write-line-protocol-to-influxdb) section.
|
[Get started writing data](/influxdb/cloud-iox/get-started/write/#write-line-protocol-to-influxdb) section.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ query engine which provides a SQL syntax similar to PostgreSQL.
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
This is a brief introduction to writing SQL queries for InfluxDB.
|
This is a brief introduction to writing SQL queries for InfluxDB.
|
||||||
For more in-depth details, see the [SQL reference documentation](/influxdb/cloud-iox/reference/sql/).
|
For more in-depth details, see [Query data with SQL](/influxdb/cloud-iox/query-data/sql/).
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
InfluxDB SQL queries most commonly include the following clauses:
|
InfluxDB SQL queries most commonly include the following clauses:
|
||||||
|
@ -78,10 +78,10 @@ InfluxDB SQL queries most commonly include the following clauses:
|
||||||
|
|
||||||
{{% influxdb/custom-timestamps %}}
|
{{% influxdb/custom-timestamps %}}
|
||||||
```sql
|
```sql
|
||||||
-- Return the average temperature and humidity from each room
|
-- Return the average temperature and humidity within time bounds from each room
|
||||||
SELECT
|
SELECT
|
||||||
mean(temp),
|
avg(temp),
|
||||||
mean(hum),
|
avg(hum),
|
||||||
room
|
room
|
||||||
FROM
|
FROM
|
||||||
home
|
home
|
||||||
|
@ -107,7 +107,7 @@ SELECT * FROM measurement
|
||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
measurement
|
home
|
||||||
WHERE
|
WHERE
|
||||||
time >= '2022-01-01T08:00:00Z'
|
time >= '2022-01-01T08:00:00Z'
|
||||||
AND time <= '2022-01-01T20:00:00Z'
|
AND time <= '2022-01-01T20:00:00Z'
|
||||||
|
@ -116,19 +116,19 @@ WHERE
|
||||||
|
|
||||||
{{% expand "Select a specific field within relative time bounds" %}}
|
{{% expand "Select a specific field within relative time bounds" %}}
|
||||||
```sql
|
```sql
|
||||||
SELECT field1 FROM measurement WHERE time >= now() - INTERVAL '1 day'
|
SELECT temp FROM home WHERE time >= now() - INTERVAL '1 day'
|
||||||
```
|
```
|
||||||
{{% /expand %}}
|
{{% /expand %}}
|
||||||
|
|
||||||
{{% expand "Select specific fields and tags from a measurement" %}}
|
{{% expand "Select specific fields and tags from a measurement" %}}
|
||||||
```sql
|
```sql
|
||||||
SELECT field1, field2, tag1 FROM measurement
|
SELECT temp, room FROM home
|
||||||
```
|
```
|
||||||
{{% /expand %}}
|
{{% /expand %}}
|
||||||
|
|
||||||
{{% expand "Select data based on tag value" %}}
|
{{% expand "Select data based on tag value" %}}
|
||||||
```sql
|
```sql
|
||||||
SELECT * FROM measurement WHERE tag1 = 'value1'
|
SELECT * FROM home WHERE room = 'Kitchen'
|
||||||
```
|
```
|
||||||
{{% /expand %}}
|
{{% /expand %}}
|
||||||
|
|
||||||
|
@ -137,11 +137,11 @@ SELECT * FROM measurement WHERE tag1 = 'value1'
|
||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
measurement
|
home
|
||||||
WHERE
|
WHERE
|
||||||
time >= '2022-01-01T08:00:00Z'
|
time >= '2022-01-01T08:00:00Z'
|
||||||
AND time <= '2022-01-01T20:00:00Z'
|
AND time <= '2022-01-01T20:00:00Z'
|
||||||
AND tag1 = 'value1'
|
AND room = 'Living Room'
|
||||||
```
|
```
|
||||||
{{% /expand %}}
|
{{% /expand %}}
|
||||||
|
|
||||||
|
@ -149,14 +149,14 @@ WHERE
|
||||||
```sql
|
```sql
|
||||||
SELECT
|
SELECT
|
||||||
DATE_BIN(INTERVAL '1 hour', time, '2022-01-01T00:00:00Z'::TIMESTAMP) as time,
|
DATE_BIN(INTERVAL '1 hour', time, '2022-01-01T00:00:00Z'::TIMESTAMP) as time,
|
||||||
mean(field1),
|
selector_max(temp, DATE_BIN(INTERVAL '1 hour', time, '2022-01-01T00:00:00Z'::TIMESTAMP))['value'] AS 'max temp',
|
||||||
sum(field2),
|
room
|
||||||
tag1
|
|
||||||
FROM
|
FROM
|
||||||
home
|
home
|
||||||
GROUP BY
|
GROUP BY
|
||||||
time,
|
DATE_BIN(INTERVAL '1 hour', time, '2022-01-01T00:00:00Z'::TIMESTAMP),
|
||||||
tag1
|
'max temp',
|
||||||
|
room
|
||||||
```
|
```
|
||||||
{{% /expand %}}
|
{{% /expand %}}
|
||||||
{{< /expand-wrapper >}}
|
{{< /expand-wrapper >}}
|
||||||
|
|
|
@ -182,8 +182,8 @@ export INFLUX_TOKEN=<YOUR_INFLUXDB_API_TOKEN>
|
||||||
getting started tutorial. All examples in this tutorial assume a bucket named
|
getting started tutorial. All examples in this tutorial assume a bucket named
|
||||||
**"get-started"**.
|
**"get-started"**.
|
||||||
|
|
||||||
Use the **InfluxDB UI**, **`influx` CLI**, or **InfluxDB API** to create a
|
Use the **InfluxDB UI**, **`influx` CLI**, or **InfluxDB API** to [create a
|
||||||
new bucket.
|
bucket](/influxdb/cloud-iox/admin/buckets/create-bucket/).
|
||||||
|
|
||||||
{{< tabs-wrapper >}}
|
{{< tabs-wrapper >}}
|
||||||
{{% tabs %}}
|
{{% tabs %}}
|
||||||
|
|
Loading…
Reference in New Issue