Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion src/UserGuide/Master/Table/Basic-Concept/Query-Data.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,33 @@ Total line number = 7
It costs 0.106s
```

**Example 3:Multi device time aligned query**

```SQL
IoTDB> SELECT date_bin_gapfill(1d, TIME) AS a_time,
device_id,
AVG(temperature) AS avg_temp
FROM table1
WHERE TIME >= 2024-11-26 13:00:00
AND TIME <= 2024-11-27 17:00:00
GROUP BY 1, device_id FILL METHOD PREVIOUS;
```

**Result**:

```SQL
+-----------------------------+---------+--------+
| a_time|device_id|avg_temp|
+-----------------------------+---------+--------+
|2024-11-26T08:00:00.000+08:00| 100| 90.0|
|2024-11-27T08:00:00.000+08:00| 100| 90.0|
|2024-11-26T08:00:00.000+08:00| 101| 90.0|
|2024-11-27T08:00:00.000+08:00| 101| 85.0|
+-----------------------------+---------+--------+
Total line number = 4
It costs 0.048s
```

### 3.3 Aggregation Query

**Example**: Calculate the average, maximum, and minimum temperature for each `device_id` within a specific time range.
Expand Down Expand Up @@ -213,7 +240,7 @@ IoTDB> SELECT device_id,date_bin(1d ,time) as day_time, AVG(temperature) as avg_
Total line number = 5
It costs 0.066s
```
### 3.6 Multi sequence downsampling query with misaligned timestamps
### 3.6 Multi device downsampling alignment query

#### 3.6.1 Sampling Frequency is the Same, but Time is Different

Expand Down
2 changes: 1 addition & 1 deletion src/UserGuide/Master/Table/SQL-Manual/Nested-Queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -878,4 +878,4 @@ Note:

**Example:**

* Downsampling queries for multiple sequences with misaligned timestamps. For detailed examples, see: [Example](../Basic-Concept/Query-Data.md#36-multi-sequence-downsampling-query-with-misaligned-timestamps)
* * Multi device downsampling alignment query. For detailed examples, see: [Example](../Basic-Concept/Query-Data.md#36-multi-device-downsampling-alignment-query)
28 changes: 27 additions & 1 deletion src/UserGuide/latest-Table/Basic-Concept/Query-Data.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,32 @@ IoTDB> SELECT time, temperature, humidity
Total line number = 7
It costs 0.106s
```
**Example 3:Multi device time aligned query**

```SQL
IoTDB> SELECT date_bin_gapfill(1d, TIME) AS a_time,
device_id,
AVG(temperature) AS avg_temp
FROM table1
WHERE TIME >= 2024-11-26 13:00:00
AND TIME <= 2024-11-27 17:00:00
GROUP BY 1, device_id FILL METHOD PREVIOUS;
```

**Result**:

```SQL
+-----------------------------+---------+--------+
| a_time|device_id|avg_temp|
+-----------------------------+---------+--------+
|2024-11-26T08:00:00.000+08:00| 100| 90.0|
|2024-11-27T08:00:00.000+08:00| 100| 90.0|
|2024-11-26T08:00:00.000+08:00| 101| 90.0|
|2024-11-27T08:00:00.000+08:00| 101| 85.0|
+-----------------------------+---------+--------+
Total line number = 4
It costs 0.048s
```

### 3.3 Aggregation Query

Expand Down Expand Up @@ -213,7 +239,7 @@ IoTDB> SELECT device_id,date_bin(1d ,time) as day_time, AVG(temperature) as avg_
Total line number = 5
It costs 0.066s
```
### 3.6 Multi sequence downsampling query with misaligned timestamps
### 3.6 Multi device downsampling alignment query

#### 3.6.1 Sampling Frequency is the Same, but Time is Different

Expand Down
2 changes: 1 addition & 1 deletion src/UserGuide/latest-Table/SQL-Manual/Nested-Queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -878,4 +878,4 @@ Note:

**Example:**

* Downsampling queries for multiple sequences with misaligned timestamps. For detailed examples, see: [Example](../Basic-Concept/Query-Data.md#36-multi-sequence-downsampling-query-with-misaligned-timestamps)
* Multi device downsampling alignment query. For detailed examples, see: [Example](../Basic-Concept/Query-Data.md#36-multi-device-downsampling-alignment-query)
29 changes: 28 additions & 1 deletion src/zh/UserGuide/Master/Table/Basic-Concept/Query-Data.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,33 @@ Total line number = 7
It costs 0.106s
```

**示例4:多设备按时间对齐查询**

```SQL
IoTDB> SELECT date_bin_gapfill(1d, TIME) AS a_time,
device_id,
AVG(temperature) AS avg_temp
FROM table1
WHERE TIME >= 2024-11-26 13:00:00
AND TIME <= 2024-11-27 17:00:00
GROUP BY 1, device_id FILL METHOD PREVIOUS;
```

执行结果如下:

```SQL
+-----------------------------+---------+--------+
| a_time|device_id|avg_temp|
+-----------------------------+---------+--------+
|2024-11-26T08:00:00.000+08:00| 100| 90.0|
|2024-11-27T08:00:00.000+08:00| 100| 90.0|
|2024-11-26T08:00:00.000+08:00| 101| 90.0|
|2024-11-27T08:00:00.000+08:00| 101| 85.0|
+-----------------------------+---------+--------+
Total line number = 4
It costs 0.048s
```

### 3.3 聚合查询

**示例:查询计算了在指定时间范围内,每个`device_id`的平均温度、最高温度和最低温度。**
Expand Down Expand Up @@ -215,7 +242,7 @@ Total line number = 5
It costs 0.066s
```

### 3.6 时间戳不对齐的多序列降采样查询
### 3.6 多设备降采样对齐查询

#### 3.6.1 采样频率相同,时间不同

Expand Down
2 changes: 1 addition & 1 deletion src/zh/UserGuide/Master/Table/SQL-Manual/Nested-Queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -877,4 +877,4 @@ IoTDB> SELECT s1 <=

**示例:**

* 时间戳不对齐的多序列降采样查询,详细示例可见:[示例](../Basic-Concept/Query-Data.md#36-时间戳不对齐的多序列降采样查询)
* 多设备降采样对齐查询,详细示例可见:[示例](../Basic-Concept/Query-Data.md#36-多设备降采样对齐查询)
29 changes: 28 additions & 1 deletion src/zh/UserGuide/latest-Table/Basic-Concept/Query-Data.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,33 @@ Total line number = 7
It costs 0.106s
```

**示例4:多设备按时间对齐查询**

```SQL
IoTDB> SELECT date_bin_gapfill(1d, TIME) AS a_time,
device_id,
AVG(temperature) AS avg_temp
FROM table1
WHERE TIME >= 2024-11-26 13:00:00
AND TIME <= 2024-11-27 17:00:00
GROUP BY 1, device_id FILL METHOD PREVIOUS;
```

执行结果如下:

```SQL
+-----------------------------+---------+--------+
| a_time|device_id|avg_temp|
+-----------------------------+---------+--------+
|2024-11-26T08:00:00.000+08:00| 100| 90.0|
|2024-11-27T08:00:00.000+08:00| 100| 90.0|
|2024-11-26T08:00:00.000+08:00| 101| 90.0|
|2024-11-27T08:00:00.000+08:00| 101| 85.0|
+-----------------------------+---------+--------+
Total line number = 4
It costs 0.048s
```

### 3.3 聚合查询

**示例:查询计算了在指定时间范围内,每个`device_id`的平均温度、最高温度和最低温度。**
Expand Down Expand Up @@ -215,7 +242,7 @@ Total line number = 5
It costs 0.066s
```

### 3.6 时间戳不对齐的多序列降采样查询
### 3.6 多设备降采样对齐查询

#### 3.6.1 采样频率相同,时间不同

Expand Down
2 changes: 1 addition & 1 deletion src/zh/UserGuide/latest-Table/SQL-Manual/Nested-Queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -877,4 +877,4 @@ IoTDB> SELECT s1 <=

**示例:**

* 时间戳不对齐的多序列降采样查询,详细示例可见:[示例](../Basic-Concept/Query-Data.md#36-时间戳不对齐的多序列降采样查询)
* 多设备降采样对齐查询,详细示例可见:[示例](../Basic-Concept/Query-Data.md#36-多设备降采样对齐查询)