You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hu...@apache.org on 2022/11/23 08:36:41 UTC

[iotdb] 02/03: fix doc

This is an automated email from the ASF dual-hosted git repository.

hui pushed a commit to branch lmh/FixSqlOrder
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 829b6149923aeac4abd022c556c15fa76d46519a
Author: liuminghui233 <54...@qq.com>
AuthorDate: Wed Nov 23 16:26:37 2022 +0800

    fix doc
---
 docs/UserGuide/Query-Data/Overview.md    | 17 ++++++++++-------
 docs/zh/UserGuide/Query-Data/Overview.md | 18 +++++++++---------
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/docs/UserGuide/Query-Data/Overview.md b/docs/UserGuide/Query-Data/Overview.md
index ab751b8ec2..82e697770d 100644
--- a/docs/UserGuide/Query-Data/Overview.md
+++ b/docs/UserGuide/Query-Data/Overview.md
@@ -26,18 +26,21 @@
 In IoTDB, `SELECT` statement is used to retrieve data from one or more selected time series. Here is the syntax definition of `SELECT` statement:
 
 ```sql
-SELECT [LAST] resultColumn [, resultColumn] ...
+SELECT [LAST] selectExpr [, selectExpr] ...
     [INTO intoItem [, intoItem] ...]
     FROM prefixPath [, prefixPath] ...
     [WHERE whereCondition]
-    [GROUP BY ([startTime, endTime), interval, slidingStep)]
-    [GROUP BY LEVEL = levelNum [, levelNum] ...]
-    [FILL ({PREVIOUS | LINEAR | constant})]
+    [GROUP BY {
+        ([startTime, endTime), interval [, slidingStep]) |
+        LEVEL = levelNum [, levelNum] ... |
+        TAGS(tagKey [, tagKey] ... )
+    }]
     [HAVING havingCondition]
-    [ORDER BY TIME {ASC | DESC}]
-    [LIMIT rowLimit] [OFFSET rowOffset]
+    [ORDER BY sortKey {ASC | DESC}]
+    [FILL ({PREVIOUS | LINEAR | constant})]
     [SLIMIT seriesLimit] [SOFFSET seriesOffset]
-    [ALIGN BY DEVICE]
+    [LIMIT rowLimit] [OFFSET rowOffset]
+    [ALIGN BY {TIME | DEVICE}]
 ```
 
 The most commonly used clauses of `SELECT` statements are these:
diff --git a/docs/zh/UserGuide/Query-Data/Overview.md b/docs/zh/UserGuide/Query-Data/Overview.md
index 4b226c73b6..81f6ad2694 100644
--- a/docs/zh/UserGuide/Query-Data/Overview.md
+++ b/docs/zh/UserGuide/Query-Data/Overview.md
@@ -29,17 +29,18 @@
 SELECT [LAST] selectExpr [, selectExpr] ...
     [INTO intoItem [, intoItem] ...]
     FROM prefixPath [, prefixPath] ...
-    [ALIGN BY {TIME | DEVICE}]
     [WHERE whereCondition]
     [GROUP BY {
-        ([startTime, endTime), interval, slidingStep) |
-        LEVEL = levelNum [, levelNum] ...
+        ([startTime, endTime), interval [, slidingStep]) |
+        LEVEL = levelNum [, levelNum] ... |
+        TAGS(tagKey [, tagKey] ... )
     }]
     [HAVING havingCondition]
     [ORDER BY sortKey {ASC | DESC}]
     [FILL ({PREVIOUS | LINEAR | constant})]
     [SLIMIT seriesLimit] [SOFFSET seriesOffset]
     [LIMIT rowLimit] [OFFSET rowOffset]
+    [ALIGN BY {TIME | DEVICE}]
 ```
 
 ## 语法说明
@@ -62,12 +63,6 @@ SELECT [LAST] selectExpr [, selectExpr] ...
 - `FROM` 子句包含要查询的一个或多个时间序列的路径前缀,支持使用通配符。
 - 在执行查询时,会将 `FROM` 子句中的路径前缀和 `SELECT` 子句中的后缀进行拼接得到完整的查询目标序列。
 
-### `ALIGN BY` 子句
-
-- 查询结果集默认**按时间对齐**,包含一列时间列和若干个值列,每一行数据各列的时间戳相同。
-- 除按时间对齐之外,还支持**按设备对齐**,查询结果集包含一列时间列、一列设备列和若干个值列。
-- 详细说明及示例见文档 [查询对齐模式](./Align-By.md) 。
-
 ### `WHERE` 子句
 
 - `WHERE` 子句指定了对数据行的筛选条件,由一个 `whereCondition` 组成。
@@ -112,6 +107,11 @@ SELECT [LAST] selectExpr [, selectExpr] ...
 - `LIMIT` 指定查询结果的行数,`OFFSET` 指定查询结果显示的起始行位置。
 - 关于查询结果分页,详细说明及示例见文档 [结果集分页](./Pagination.md) 。
 
+### `ALIGN BY` 子句
+
+- 查询结果集默认**按时间对齐**,包含一列时间列和若干个值列,每一行数据各列的时间戳相同。
+- 除按时间对齐之外,还支持**按设备对齐**,查询结果集包含一列时间列、一列设备列和若干个值列。
+- 详细说明及示例见文档 [查询对齐模式](./Align-By.md) 。
 
 ## SQL 示例