Skip to content

Commit 2eccafb

Browse files
authored
fix latest point query command in data query (#765)
1 parent 24cc010 commit 2eccafb

File tree

4 files changed

+28
-29
lines changed

4 files changed

+28
-29
lines changed

src/UserGuide/Master/Table/Basic-Concept/Query-Data.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ IoTDB> SELECT time, temperature, humidity
139139
Total line number = 7
140140
It costs 0.106s
141141
```
142-
143142
**Example 3:Multi device time aligned query**
144143

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

198197
```SQL
199-
IoTDB> SELECT device_id,last(temperature),last_by(time,temperature)
198+
IoTDB> SELECT device_id,last(time),last_by(temperature,time)
200199
FROM table1
201200
GROUP BY device_id;
202201
```
203202

204203
**Result**:
205204

206205
```SQL
207-
+---------+-----+-----------------------------+
208-
|device_id|_col1| _col2|
209-
+---------+-----+-----------------------------+
210-
| 100| 90.0|2024-11-29T18:30:00.000+08:00|
211-
| 101| 90.0|2024-11-30T14:30:00.000+08:00|
212-
+---------+-----+-----------------------------+
206+
+---------+-----------------------------+-----+
207+
|device_id| _col1|_col2|
208+
+---------+-----------------------------+-----+
209+
| 100|2024-11-29T18:30:00.000+08:00| 90.0|
210+
| 101|2024-11-30T14:30:00.000+08:00| 90.0|
211+
+---------+-----------------------------+-----+
213212
Total line number = 2
214213
It costs 0.090s
215214
```

src/UserGuide/latest-Table/Basic-Concept/Query-Data.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,20 +195,20 @@ It costs 0.278s
195195
**Example**: Retrieve the latest record for each `device_id`, including the temperature value and the timestamp of the last record.
196196

197197
```SQL
198-
IoTDB> SELECT device_id,last(temperature),last_by(time,temperature)
198+
IoTDB> SELECT device_id,last(time),last_by(temperature,time)
199199
FROM table1
200200
GROUP BY device_id;
201201
```
202202

203203
**Result**:
204204

205205
```SQL
206-
+---------+-----+-----------------------------+
207-
|device_id|_col1| _col2|
208-
+---------+-----+-----------------------------+
209-
| 100| 90.0|2024-11-29T18:30:00.000+08:00|
210-
| 101| 90.0|2024-11-30T14:30:00.000+08:00|
211-
+---------+-----+-----------------------------+
206+
+---------+-----------------------------+-----+
207+
|device_id| _col1|_col2|
208+
+---------+-----------------------------+-----+
209+
| 100|2024-11-29T18:30:00.000+08:00| 90.0|
210+
| 101|2024-11-30T14:30:00.000+08:00| 90.0|
211+
+---------+-----------------------------+-----+
212212
Total line number = 2
213213
It costs 0.090s
214214
```

src/zh/UserGuide/Master/Table/Basic-Concept/Query-Data.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,20 +197,20 @@ It costs 0.278s
197197
**示例:查询表中每个 `device_id` 返回最后一条记录,包含该记录的温度值以及在该设备中基于时间和温度排序的最后一条记录。**
198198

199199
```SQL
200-
IoTDB> SELECT device_id,last(temperature),last_by(time,temperature)
200+
IoTDB> SELECT device_id,last(time),last_by(temperature,time)
201201
FROM table1
202202
GROUP BY device_id;
203203
```
204204

205205
执行结果如下:
206206

207207
```SQL
208-
+---------+-----+-----------------------------+
209-
|device_id|_col1| _col2|
210-
+---------+-----+-----------------------------+
211-
| 100| 90.0|2024-11-29T18:30:00.000+08:00|
212-
| 101| 90.0|2024-11-30T14:30:00.000+08:00|
213-
+---------+-----+-----------------------------+
208+
+---------+-----------------------------+-----+
209+
|device_id| _col1|_col2|
210+
+---------+-----------------------------+-----+
211+
| 100|2024-11-29T18:30:00.000+08:00| 90.0|
212+
| 101|2024-11-30T14:30:00.000+08:00| 90.0|
213+
+---------+-----------------------------+-----+
214214
Total line number = 2
215215
It costs 0.090s
216216
```

src/zh/UserGuide/latest-Table/Basic-Concept/Query-Data.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,20 +197,20 @@ It costs 0.278s
197197
**示例:查询表中每个 `device_id` 返回最后一条记录,包含该记录的温度值以及在该设备中基于时间和温度排序的最后一条记录。**
198198

199199
```SQL
200-
IoTDB> SELECT device_id,last(temperature),last_by(time,temperature)
200+
IoTDB> SELECT device_id,last(time),last_by(temperature,time)
201201
FROM table1
202202
GROUP BY device_id;
203203
```
204204

205205
执行结果如下:
206206

207207
```SQL
208-
+---------+-----+-----------------------------+
209-
|device_id|_col1| _col2|
210-
+---------+-----+-----------------------------+
211-
| 100| 90.0|2024-11-29T18:30:00.000+08:00|
212-
| 101| 90.0|2024-11-30T14:30:00.000+08:00|
213-
+---------+-----+-----------------------------+
208+
+---------+-----------------------------+-----+
209+
|device_id| _col1|_col2|
210+
+---------+-----------------------------+-----+
211+
| 100|2024-11-29T18:30:00.000+08:00| 90.0|
212+
| 101|2024-11-30T14:30:00.000+08:00| 90.0|
213+
+---------+-----------------------------+-----+
214214
Total line number = 2
215215
It costs 0.090s
216216
```

0 commit comments

Comments
 (0)