diff --git a/src/UserGuide/Master/Tree/Basic-Concept/Query-Data.md b/src/UserGuide/Master/Tree/Basic-Concept/Query-Data.md index f98c5ec37..f020821f0 100644 --- a/src/UserGuide/Master/Tree/Basic-Concept/Query-Data.md +++ b/src/UserGuide/Master/Tree/Basic-Concept/Query-Data.md @@ -427,6 +427,19 @@ Total line number = 2 It costs 0.002s ``` +**Note:** The requirement to query the latest data point with other filtering conditions can be implemented through function composition. For example: + +``` +IoTDB> select max_time(*), last_value(*) from root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00 and status = false align by device ++-----------------+---------------------+----------------+-----------------------+------------------+ +| Device|max_time(temperature)|max_time(status)|last_value(temperature)|last_value(status)| ++-----------------+---------------------+----------------+-----------------------+------------------+ +|root.ln.wf01.wt01| 1510077540000| 1510077540000| 21.067368| false| ++-----------------+---------------------+----------------+-----------------------+------------------+ +Total line number = 1 +It costs 0.021s +``` + ## 3. `WHERE` CLAUSE In IoTDB query statements, two filter conditions, **time filter** and **value filter**, are supported. diff --git a/src/UserGuide/V1.3.x/Basic-Concept/Query-Data.md b/src/UserGuide/V1.3.x/Basic-Concept/Query-Data.md index d312503c9..5d85a1563 100644 --- a/src/UserGuide/V1.3.x/Basic-Concept/Query-Data.md +++ b/src/UserGuide/V1.3.x/Basic-Concept/Query-Data.md @@ -427,6 +427,20 @@ Total line number = 2 It costs 0.002s ``` +**Note:** The requirement to query the latest data point with other filtering conditions can be implemented through function composition. For example: + +``` +IoTDB> select max_time(*), last_value(*) from root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00 and status = false align by device ++-----------------+---------------------+----------------+-----------------------+------------------+ +| Device|max_time(temperature)|max_time(status)|last_value(temperature)|last_value(status)| ++-----------------+---------------------+----------------+-----------------------+------------------+ +|root.ln.wf01.wt01| 1510077540000| 1510077540000| 21.067368| false| ++-----------------+---------------------+----------------+-----------------------+------------------+ +Total line number = 1 +It costs 0.021s +``` + + ## `WHERE` CLAUSE In IoTDB query statements, two filter conditions, **time filter** and **value filter**, are supported. diff --git a/src/UserGuide/dev-1.3/Basic-Concept/Query-Data.md b/src/UserGuide/dev-1.3/Basic-Concept/Query-Data.md index d312503c9..5d85a1563 100644 --- a/src/UserGuide/dev-1.3/Basic-Concept/Query-Data.md +++ b/src/UserGuide/dev-1.3/Basic-Concept/Query-Data.md @@ -427,6 +427,20 @@ Total line number = 2 It costs 0.002s ``` +**Note:** The requirement to query the latest data point with other filtering conditions can be implemented through function composition. For example: + +``` +IoTDB> select max_time(*), last_value(*) from root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00 and status = false align by device ++-----------------+---------------------+----------------+-----------------------+------------------+ +| Device|max_time(temperature)|max_time(status)|last_value(temperature)|last_value(status)| ++-----------------+---------------------+----------------+-----------------------+------------------+ +|root.ln.wf01.wt01| 1510077540000| 1510077540000| 21.067368| false| ++-----------------+---------------------+----------------+-----------------------+------------------+ +Total line number = 1 +It costs 0.021s +``` + + ## `WHERE` CLAUSE In IoTDB query statements, two filter conditions, **time filter** and **value filter**, are supported. diff --git a/src/UserGuide/latest/Basic-Concept/Query-Data.md b/src/UserGuide/latest/Basic-Concept/Query-Data.md index f98c5ec37..ce50bb6f3 100644 --- a/src/UserGuide/latest/Basic-Concept/Query-Data.md +++ b/src/UserGuide/latest/Basic-Concept/Query-Data.md @@ -427,6 +427,20 @@ Total line number = 2 It costs 0.002s ``` +**Note:** The requirement to query the latest data point with other filtering conditions can be implemented through function composition. For example: + +``` +IoTDB> select max_time(*), last_value(*) from root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00 and status = false align by device ++-----------------+---------------------+----------------+-----------------------+------------------+ +| Device|max_time(temperature)|max_time(status)|last_value(temperature)|last_value(status)| ++-----------------+---------------------+----------------+-----------------------+------------------+ +|root.ln.wf01.wt01| 1510077540000| 1510077540000| 21.067368| false| ++-----------------+---------------------+----------------+-----------------------+------------------+ +Total line number = 1 +It costs 0.021s +``` + + ## 3. `WHERE` CLAUSE In IoTDB query statements, two filter conditions, **time filter** and **value filter**, are supported. diff --git a/src/zh/UserGuide/Master/Tree/Basic-Concept/Query-Data.md b/src/zh/UserGuide/Master/Tree/Basic-Concept/Query-Data.md index b5085b32f..ba97766b3 100644 --- a/src/zh/UserGuide/Master/Tree/Basic-Concept/Query-Data.md +++ b/src/zh/UserGuide/Master/Tree/Basic-Concept/Query-Data.md @@ -680,6 +680,20 @@ Total line number = 2 It costs 0.002s ``` +**注意:** 可以通过函数组合方式实现其他过滤条件查询最新点的需求,例如 + +``` +IoTDB> select max_time(*), last_value(*) from root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00 and status = false align by device ++-----------------+---------------------+----------------+-----------------------+------------------+ +| Device|max_time(temperature)|max_time(status)|last_value(temperature)|last_value(status)| ++-----------------+---------------------+----------------+-----------------------+------------------+ +|root.ln.wf01.wt01| 1510077540000| 1510077540000| 21.067368| false| ++-----------------+---------------------+----------------+-----------------------+------------------+ +Total line number = 1 +It costs 0.021s +``` + + ## 3. 查询过滤条件(WHERE 子句) `WHERE` 子句指定了对数据行的筛选条件,由一个 `whereCondition` 组成。 diff --git a/src/zh/UserGuide/V1.3.x/Basic-Concept/Query-Data.md b/src/zh/UserGuide/V1.3.x/Basic-Concept/Query-Data.md index cc7895a9d..ca7730a12 100644 --- a/src/zh/UserGuide/V1.3.x/Basic-Concept/Query-Data.md +++ b/src/zh/UserGuide/V1.3.x/Basic-Concept/Query-Data.md @@ -680,6 +680,20 @@ Total line number = 2 It costs 0.002s ``` +**注意:** 可以通过函数组合方式实现其他过滤条件查询最新点的需求,例如 + +``` +IoTDB> select max_time(*), last_value(*) from root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00 and status = false align by device ++-----------------+---------------------+----------------+-----------------------+------------------+ +| Device|max_time(temperature)|max_time(status)|last_value(temperature)|last_value(status)| ++-----------------+---------------------+----------------+-----------------------+------------------+ +|root.ln.wf01.wt01| 1510077540000| 1510077540000| 21.067368| false| ++-----------------+---------------------+----------------+-----------------------+------------------+ +Total line number = 1 +It costs 0.021s +``` + + ## 查询过滤条件(WHERE 子句) `WHERE` 子句指定了对数据行的筛选条件,由一个 `whereCondition` 组成。 diff --git a/src/zh/UserGuide/dev-1.3/Basic-Concept/Query-Data.md b/src/zh/UserGuide/dev-1.3/Basic-Concept/Query-Data.md index cc7895a9d..04a053eac 100644 --- a/src/zh/UserGuide/dev-1.3/Basic-Concept/Query-Data.md +++ b/src/zh/UserGuide/dev-1.3/Basic-Concept/Query-Data.md @@ -613,7 +613,7 @@ select last [COMMA ]* from < PrefixPath > [COMMA < PrefixPath >]* < 其含义是: 查询时间序列 prefixPath.path 中最近时间戳的数据。 -- `whereClause` 中当前只支持时间过滤条件,任何其他过滤条件都将会返回异常。当缓存的最新点不满足过滤条件时,IoTDB 需要从存储中获取结果,此时性能将会有所下降。 +- `whereClause` 中当前**只支持时间过滤条件**,任何其他过滤条件都将会返回异常。当缓存的最新点不满足过滤条件时,IoTDB 需要从存储中获取结果,此时性能将会有所下降。 - 结果集为四列的结构: @@ -680,6 +680,20 @@ Total line number = 2 It costs 0.002s ``` +**注意:** 可以通过函数组合方式实现其他过滤条件查询最新点的需求,例如 + +``` +IoTDB> select max_time(*), last_value(*) from root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00 and status = false align by device ++-----------------+---------------------+----------------+-----------------------+------------------+ +| Device|max_time(temperature)|max_time(status)|last_value(temperature)|last_value(status)| ++-----------------+---------------------+----------------+-----------------------+------------------+ +|root.ln.wf01.wt01| 1510077540000| 1510077540000| 21.067368| false| ++-----------------+---------------------+----------------+-----------------------+------------------+ +Total line number = 1 +It costs 0.021s +``` + + ## 查询过滤条件(WHERE 子句) `WHERE` 子句指定了对数据行的筛选条件,由一个 `whereCondition` 组成。 diff --git a/src/zh/UserGuide/latest/Basic-Concept/Query-Data.md b/src/zh/UserGuide/latest/Basic-Concept/Query-Data.md index b5085b32f..ba97766b3 100644 --- a/src/zh/UserGuide/latest/Basic-Concept/Query-Data.md +++ b/src/zh/UserGuide/latest/Basic-Concept/Query-Data.md @@ -680,6 +680,20 @@ Total line number = 2 It costs 0.002s ``` +**注意:** 可以通过函数组合方式实现其他过滤条件查询最新点的需求,例如 + +``` +IoTDB> select max_time(*), last_value(*) from root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00 and status = false align by device ++-----------------+---------------------+----------------+-----------------------+------------------+ +| Device|max_time(temperature)|max_time(status)|last_value(temperature)|last_value(status)| ++-----------------+---------------------+----------------+-----------------------+------------------+ +|root.ln.wf01.wt01| 1510077540000| 1510077540000| 21.067368| false| ++-----------------+---------------------+----------------+-----------------------+------------------+ +Total line number = 1 +It costs 0.021s +``` + + ## 3. 查询过滤条件(WHERE 子句) `WHERE` 子句指定了对数据行的筛选条件,由一个 `whereCondition` 组成。