From 5a09ffebb9bd446cf1f15eda6d8fc0b12afe0556 Mon Sep 17 00:00:00 2001 From: malong Date: Fri, 15 Nov 2019 15:06:01 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=8C=89=E6=97=B6=E9=97=B4=E5=91=A8?= =?UTF-8?q?=E6=9C=9F=E8=81=9A=E5=90=88=E6=9F=A5=E8=AF=A2=20=E4=B8=AD=20WHE?= =?UTF-8?q?RE=E5=90=8E=E9=9D=A2=E7=9A=84name=20=E6=94=B9=E4=B8=BA=20locati?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- documentation/tdenginedocs-cn/super-table/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/tdenginedocs-cn/super-table/index.html b/documentation/tdenginedocs-cn/super-table/index.html index 5ee9587b2f..3d2681990a 100644 --- a/documentation/tdenginedocs-cn/super-table/index.html +++ b/documentation/tdenginedocs-cn/super-table/index.html @@ -105,6 +105,6 @@ GROUP BY location, type

查询仅位于北京以外地区的温度传感器最近24小时(24h)采样值的数量count(*)、平均温度avg(degree)、最高温度max(degree)和最低温度min(degree),将采集结果按照10分钟为周期进行聚合,并将结果按所处地域(location)和传感器类型(type)再次进行聚合。

SELECT COUNT(*), AVG(degree), MAX(degree), MIN(degree)
 FROM thermometer
-WHERE name<>'beijing' and ts>=now-1d
+WHERE location<>'beijing' and ts>=now-1d
 INTERVAL(10M)
 GROUP BY location, type
回去 From a52ea6e614c465e2b72fdb39e887f50dc5a9f3c9 Mon Sep 17 00:00:00 2001 From: malong Date: Fri, 15 Nov 2019 15:22:39 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=B1=BBSQL=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E7=94=A8=E6=8F=92=E5=85=A5=E6=88=96=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=20=E6=94=B9=E4=B8=BA=EF=BC=9A=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=B1=BBSQL=E8=AF=AD=E8=A8=80=E6=8F=92=E5=85=A5?= =?UTF-8?q?=E6=88=96=E6=9F=A5=E8=AF=A2=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- documentation/tdenginedocs-cn/getting-started/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/tdenginedocs-cn/getting-started/index.html b/documentation/tdenginedocs-cn/getting-started/index.html index d7e8fe311c..65ef667d00 100644 --- a/documentation/tdenginedocs-cn/getting-started/index.html +++ b/documentation/tdenginedocs-cn/getting-started/index.html @@ -63,7 +63,7 @@ Query OK, 2 row(s) in set (0.001700s)

主要功能

TDengine的核心功能是时序数据库。除此之外,为减少研发的复杂度、系统维护的难度,TDengine还提供缓存、消息队列、订阅、流式计算等功能。更详细的功能如下:

写数据时自动建子表

-

在某些特殊场景中,用户在写数据时并不确定某个设备的表是否存在,此时可使用自动建表语法来实现写入数据时里用超级表定义的表结构自动创建不存在的子表,若该表已存在则不会建立新表。注意:自动建表语句只能自动建立子表而不能建立超级表,这就要求超级表已经被事先定义好。自动建表语法跟insert/import语法非常相似,唯一区别是语句中增加了超级表和标签信息。具体语法如下:

+

在某些特殊场景中,用户在写数据时并不确定某个设备的表是否存在,此时可使用自动建表语法来实现写入数据时用超级表定义的表结构自动创建不存在的子表,若该表已存在则不会建立新表。注意:自动建表语句只能自动建立子表而不能建立超级表,这就要求超级表已经被事先定义好。自动建表语法跟insert/import语法非常相似,唯一区别是语句中增加了超级表和标签信息。具体语法如下:

INSERT INTO <tb_name> USING <stb_name> TAGS (<tag1_value>, ...) VALUES (field_value, ...) (field_value, ...) ...;

向表tb_name中插入一条或多条记录,如果tb_name这张表不存在,则会用超级表stb_name定义的表结构以及用户指定的标签值(即tag1_value…)来创建名为tb_name新表,并将用户指定的值写入表中。如果tb_name已经存在,则建表过程会被忽略,系统也不会检查tb_name的标签是否与用户指定的标签值一致,也即不会更新已存在表的标签。

INSERT INTO <tb1_name> USING <stb1_name> TAGS (<tag1_value1>, ...) VALUES (<field1_value1>, ...) (<field1_value2>, ...) ... <tb_name2> USING <stb_name2> TAGS(<tag1_value2>, ...) VALUES (<field1_value1>, ...) ...;
From 48c470e21c81c4c1c651b31d8823e15aac6573bc Mon Sep 17 00:00:00 2001 From: malong Date: Fri, 15 Nov 2019 15:47:34 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E2=80=9C=E8=B6=85=E7=BA=A7=E8=A1=A8?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E2=80=9D=E7=9A=84=E8=AF=B4=E6=98=8E=E2=80=9C?= =?UTF-8?q?2.TAGS=E5=88=97=E7=9A=84=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E6=98=AFtimestamp=E5=92=8Cnchar=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=EF=BC=9B=E6=8F=8F=E8=BF=B0=E9=94=99=E8=AF=AF=EF=BC=8C?= =?UTF-8?q?=E5=AE=9E=E9=99=85tags=E6=98=AF=E6=94=AF=E6=8C=81nchar=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- documentation/tdenginedocs-cn/super-table/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/tdenginedocs-cn/super-table/index.html b/documentation/tdenginedocs-cn/super-table/index.html index 679f4c307b..828a69bb0c 100644 --- a/documentation/tdenginedocs-cn/super-table/index.html +++ b/documentation/tdenginedocs-cn/super-table/index.html @@ -24,7 +24,7 @@ tags (location binary(20), type int)

说明:

  1. TAGS列总长度不能超过512 bytes;
  2. -
  3. TAGS列的数据类型不能是timestamp和nchar类型;
  4. +
  5. TAGS列的数据类型不能是timestamp类型;
  6. TAGS列名不能与其他列名相同;
  7. TAGS列名不能为预留关键字.
  • 显示已创建的超级表