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
15 changes: 7 additions & 8 deletions src/UserGuide/Master/Table/Basic-Concept/Query-Data.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ IoTDB> SELECT time, temperature, humidity
Total line number = 7
It costs 0.106s
```

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

```SQL
Expand Down Expand Up @@ -196,20 +195,20 @@ It costs 0.278s
**Example**: Retrieve the latest record for each `device_id`, including the temperature value and the timestamp of the last record.

```SQL
IoTDB> SELECT device_id,last(temperature),last_by(time,temperature)
IoTDB> SELECT device_id,last(time),last_by(temperature,time)
FROM table1
GROUP BY device_id;
```

**Result**:

```SQL
+---------+-----+-----------------------------+
|device_id|_col1| _col2|
+---------+-----+-----------------------------+
| 100| 90.0|2024-11-29T18:30:00.000+08:00|
| 101| 90.0|2024-11-30T14:30:00.000+08:00|
+---------+-----+-----------------------------+
+---------+-----------------------------+-----+
|device_id| _col1|_col2|
+---------+-----------------------------+-----+
| 100|2024-11-29T18:30:00.000+08:00| 90.0|
| 101|2024-11-30T14:30:00.000+08:00| 90.0|
+---------+-----------------------------+-----+
Total line number = 2
It costs 0.090s
```
Expand Down
14 changes: 7 additions & 7 deletions src/UserGuide/latest-Table/Basic-Concept/Query-Data.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,20 +195,20 @@ It costs 0.278s
**Example**: Retrieve the latest record for each `device_id`, including the temperature value and the timestamp of the last record.

```SQL
IoTDB> SELECT device_id,last(temperature),last_by(time,temperature)
IoTDB> SELECT device_id,last(time),last_by(temperature,time)
FROM table1
GROUP BY device_id;
```

**Result**:

```SQL
+---------+-----+-----------------------------+
|device_id|_col1| _col2|
+---------+-----+-----------------------------+
| 100| 90.0|2024-11-29T18:30:00.000+08:00|
| 101| 90.0|2024-11-30T14:30:00.000+08:00|
+---------+-----+-----------------------------+
+---------+-----------------------------+-----+
|device_id| _col1|_col2|
+---------+-----------------------------+-----+
| 100|2024-11-29T18:30:00.000+08:00| 90.0|
| 101|2024-11-30T14:30:00.000+08:00| 90.0|
+---------+-----------------------------+-----+
Total line number = 2
It costs 0.090s
```
Expand Down
14 changes: 7 additions & 7 deletions src/zh/UserGuide/Master/Table/Basic-Concept/Query-Data.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,20 +197,20 @@ It costs 0.278s
**示例:查询表中每个 `device_id` 返回最后一条记录,包含该记录的温度值以及在该设备中基于时间和温度排序的最后一条记录。**

```SQL
IoTDB> SELECT device_id,last(temperature),last_by(time,temperature)
IoTDB> SELECT device_id,last(time),last_by(temperature,time)
FROM table1
GROUP BY device_id;
```

执行结果如下:

```SQL
+---------+-----+-----------------------------+
|device_id|_col1| _col2|
+---------+-----+-----------------------------+
| 100| 90.0|2024-11-29T18:30:00.000+08:00|
| 101| 90.0|2024-11-30T14:30:00.000+08:00|
+---------+-----+-----------------------------+
+---------+-----------------------------+-----+
|device_id| _col1|_col2|
+---------+-----------------------------+-----+
| 100|2024-11-29T18:30:00.000+08:00| 90.0|
| 101|2024-11-30T14:30:00.000+08:00| 90.0|
+---------+-----------------------------+-----+
Total line number = 2
It costs 0.090s
```
Expand Down
14 changes: 7 additions & 7 deletions src/zh/UserGuide/latest-Table/Basic-Concept/Query-Data.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,20 +197,20 @@ It costs 0.278s
**示例:查询表中每个 `device_id` 返回最后一条记录,包含该记录的温度值以及在该设备中基于时间和温度排序的最后一条记录。**

```SQL
IoTDB> SELECT device_id,last(temperature),last_by(time,temperature)
IoTDB> SELECT device_id,last(time),last_by(temperature,time)
FROM table1
GROUP BY device_id;
```

执行结果如下:

```SQL
+---------+-----+-----------------------------+
|device_id|_col1| _col2|
+---------+-----+-----------------------------+
| 100| 90.0|2024-11-29T18:30:00.000+08:00|
| 101| 90.0|2024-11-30T14:30:00.000+08:00|
+---------+-----+-----------------------------+
+---------+-----------------------------+-----+
|device_id| _col1|_col2|
+---------+-----------------------------+-----+
| 100|2024-11-29T18:30:00.000+08:00| 90.0|
| 101|2024-11-30T14:30:00.000+08:00| 90.0|
+---------+-----------------------------+-----+
Total line number = 2
It costs 0.090s
```
Expand Down