Merge pull request #750 from malongcn/develop

时间维度聚合的实例中 group by和fill 顺序写反了
This commit is contained in:
haojun Liao 2019-11-20 13:50:40 +08:00 committed by GitHub
commit d5433a8172
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View File

@ -359,9 +359,9 @@ SELECT function_list FROM tb_name
SELECT function_list FROM stb_name SELECT function_list FROM stb_name
[WHERE where_condition] [WHERE where_condition]
[GROUP BY tags] [FILL ({ VALUE | PREV | NULL | LINEAR})]
INTERVAL (interval) INTERVAL (interval)
[FILL ({ VALUE | PREV | NULL | LINEAR})]</code></pre> [GROUP BY tags]</code></pre>
<ul> <ul>
<li>聚合时间段的长度由关键词INTERVAL指定最短时间间隔10毫秒10a。聚合查询中能够同时执行的聚合和选择函数仅限于单个输出的函数count、avg、sum 、stddev、leastsquares、percentile、min、max、first、last不能使用具有多行输出结果的函数例如top、bottom、diff以及四则运算</li> <li>聚合时间段的长度由关键词INTERVAL指定最短时间间隔10毫秒10a。聚合查询中能够同时执行的聚合和选择函数仅限于单个输出的函数count、avg、sum 、stddev、leastsquares、percentile、min、max、first、last不能使用具有多行输出结果的函数例如top、bottom、diff以及四则运算</li>
<li>WHERE语句可以指定查询的起止时间和其他过滤条件 </li> <li>WHERE语句可以指定查询的起止时间和其他过滤条件 </li>

View File

@ -54,7 +54,7 @@ STable从属于库一个STable只属于一个库但一个库可以有一
说明: 说明:
1. TAGS列总长度不能超过512 bytes 1. TAGS列总长度不能超过512 bytes
2. TAGS列的数据类型不能是timestamp和nchar类型 2. TAGS列的数据类型不能是timestamp
3. TAGS列名不能与其他列名相同; 3. TAGS列名不能与其他列名相同;
4. TAGS列名不能为预留关键字. 4. TAGS列名不能为预留关键字.
@ -218,7 +218,7 @@ GROUP BY location, type
```mysql ```mysql
SELECT COUNT(*), AVG(degree), MAX(degree), MIN(degree) SELECT COUNT(*), AVG(degree), MAX(degree), MIN(degree)
FROM thermometer FROM thermometer
WHERE name<>'beijing' and ts>=now-1d WHERE location<>'beijing' and ts>=now-1d
INTERVAL(10M) INTERVAL(10M)
GROUP BY location, type GROUP BY location, type
``` ```

View File

@ -23,7 +23,7 @@ New keyword "tags" is introduced, where tag_name is the tag name, and tag_type i
Note Note
1. The bytes of all tags together shall be less than 512 1. The bytes of all tags together shall be less than 512
2. Tag's data type can not be time stamp or nchar 2. Tag's data type can not be time stamp
3. Tag name shall be different from the field name 3. Tag name shall be different from the field name
4. Tag name shall not be the same as system keywords 4. Tag name shall not be the same as system keywords
5. Maximum number of tags is 6 5. Maximum number of tags is 6
@ -102,7 +102,7 @@ List the number of records, average, maximum, and minimum temperature every 10 m
```mysql ```mysql
SELECT COUNT(*), AVG(degree), MAX(degree), MIN(degree) SELECT COUNT(*), AVG(degree), MAX(degree), MIN(degree)
FROM thermometer FROM thermometer
WHERE name='beijing' and type=10 and ts>=now-1d WHERE location='beijing' and type=10 and ts>=now-1d
INTERVAL(10M) INTERVAL(10M)
``` ```

View File

@ -424,9 +424,9 @@ SELECT function_list FROM tb_name
SELECT function_list FROM stb_name SELECT function_list FROM stb_name
[WHERE where_condition] [WHERE where_condition]
[GROUP BY tags]
INTERVAL (interval) INTERVAL (interval)
[FILL ({ VALUE | PREV | NULL | LINEAR})] [FILL ({ VALUE | PREV | NULL | LINEAR})]
[GROUP BY tags]
``` ```
- 聚合时间段的长度由关键词INTERVAL指定最短时间间隔10毫秒10a。聚合查询中能够同时执行的聚合和选择函数仅限于单个输出的函数count、avg、sum 、stddev、leastsquares、percentile、min、max、first、last不能使用具有多行输出结果的函数例如top、bottom、diff以及四则运算 - 聚合时间段的长度由关键词INTERVAL指定最短时间间隔10毫秒10a。聚合查询中能够同时执行的聚合和选择函数仅限于单个输出的函数count、avg、sum 、stddev、leastsquares、percentile、min、max、first、last不能使用具有多行输出结果的函数例如top、bottom、diff以及四则运算

View File

@ -474,9 +474,9 @@ SELECT function_list FROM tb_name
SELECT function_list FROM stb_name SELECT function_list FROM stb_name
[WHERE where_condition] [WHERE where_condition]
[GROUP BY tags]
INTERVAL (interval) INTERVAL (interval)
[FILL ({ VALUE | PREV | NULL | LINEAR})] [FILL ({ VALUE | PREV | NULL | LINEAR})]
[GROUP BY tags]
``` ```
The downsampling time window is defined by `interval`, which is at least 10 milliseconds. The query returns a new series of downsampled data that has a series of fixed timestamps with an increment of `interval`. The downsampling time window is defined by `interval`, which is at least 10 milliseconds. The query returns a new series of downsampled data that has a series of fixed timestamps with an increment of `interval`.