diff --git a/documentation20/cn/02.getting-started/docs.md b/documentation20/cn/02.getting-started/docs.md index ab10b28fd3950bfa10e47113696de0829b2da74d..4ae4ebf4d0f71ad9bce3588cbcce5e5750fb9728 100644 --- a/documentation20/cn/02.getting-started/docs.md +++ b/documentation20/cn/02.getting-started/docs.md @@ -126,7 +126,7 @@ taos> source ; $ taosdemo ``` -该命令将在数据库 test 下面自动创建一张超级表 meters,该超级表下有 1 万张表,表名为 "d0" 到 "d9999",每张表有 1 万条记录,每条记录有 (ts, current, voltage, phase) 四个字段,时间戳从 "2017-07-14 10:40:00 000" 到 "2017-07-14 10:40:09 999",每张表带有标签 location 和 groupdId,groupdId 被设置为 1 到 10, location 被设置为 "beijing" 或者 "shanghai"。 +该命令将在数据库 test 下面自动创建一张超级表 meters,该超级表下有 1 万张表,表名为 "d0" 到 "d9999",每张表有 1 万条记录,每条记录有 (ts, current, voltage, phase) 四个字段,时间戳从 "2017-07-14 10:40:00 000" 到 "2017-07-14 10:40:09 999",每张表带有标签 location 和 groupId,groupId 被设置为 1 到 10, location 被设置为 "beijing" 或者 "shanghai"。 执行这条命令大概需要几分钟,最后共插入 1 亿条记录。 @@ -150,10 +150,10 @@ taos> select avg(current), max(voltage), min(phase) from test.meters; taos> select count(*) from test.meters where location="beijing"; ``` -- 查询 groupdId=10 的所有记录的平均值、最大值、最小值等: +- 查询 groupId=10 的所有记录的平均值、最大值、最小值等: ```mysql -taos> select avg(current), max(voltage), min(phase) from test.meters where groupdId=10; +taos> select avg(current), max(voltage), min(phase) from test.meters where groupId=10; ``` - 对表 d10 按 10s 进行平均值、最大值和最小值聚合统计: diff --git a/documentation20/cn/04.model/docs.md b/documentation20/cn/04.model/docs.md index 6f85381588c6cd131f2204bba13e64e7058f93f2..4ea592bd4af180ba8aca0a34d1d1817cf4df03ca 100644 --- a/documentation20/cn/04.model/docs.md +++ b/documentation20/cn/04.model/docs.md @@ -33,7 +33,7 @@ USE power; 一个物联网系统,往往存在多种类型的设备,比如对于电网,存在智能电表、变压器、母线、开关等等。为便于多表之间的聚合,使用TDengine, 需要对每个类型的数据采集点创建一超级表。以表一中的智能电表为例,可以使用如下的SQL命令创建超级表: ```mysql -CREATE STABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupdId int); +CREATE STABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupId int); ``` **注意:**这一指令中的 STABLE 关键字,在 2.0.15 之前的版本中需写作 TABLE 。 diff --git a/documentation20/cn/07.advanced-features/docs.md b/documentation20/cn/07.advanced-features/docs.md index 1077f299ee2a2e93589d0246af7633a6886c6756..1b4ccb4814f7adcc72c250c07bc2ec6151ea5f76 100644 --- a/documentation20/cn/07.advanced-features/docs.md +++ b/documentation20/cn/07.advanced-features/docs.md @@ -17,7 +17,7 @@ TDengine提供的连续查询与普通流计算中的时间窗口计算具有以 下面以智能电表场景为例介绍连续查询的具体使用方法。假设我们通过下列SQL语句创建了超级表和子表: ```sql -create table meters (ts timestamp, current float, voltage int, phase float) tags (location binary(64), groupdId int); +create table meters (ts timestamp, current float, voltage int, phase float) tags (location binary(64), groupId int); create table D1001 using meters tags ("Beijing.Chaoyang", 2); create table D1002 using meters tags ("Beijing.Haidian", 2); ... diff --git a/documentation20/cn/12.taos-sql/docs.md b/documentation20/cn/12.taos-sql/docs.md index 4368e5fa1dfef4300fe8e1c44b47471fb55f70e1..97b89f34466fb4a3402fcbcf8df9b4ee5d413bbd 100644 --- a/documentation20/cn/12.taos-sql/docs.md +++ b/documentation20/cn/12.taos-sql/docs.md @@ -414,13 +414,13 @@ INSERT INTO ``` 也可以在自动建表时,只是指定部分 TAGS 列的取值,未被指定的 TAGS 列将置为 NULL。例如: ```mysql - INSERT INTO d21001 USING meters (groupdId) TAGS (2) VALUES ('2021-07-13 14:06:33.196', 10.15, 217, 0.33); + INSERT INTO d21001 USING meters (groupId) TAGS (2) VALUES ('2021-07-13 14:06:33.196', 10.15, 217, 0.33); ``` 自动建表语法也支持在一条语句中向多个表插入记录。例如: ```mysql INSERT INTO d21001 USING meters TAGS ('Beijing.Chaoyang', 2) VALUES ('2021-07-13 14:06:34.630', 10.2, 219, 0.32) ('2021-07-13 14:06:35.779', 10.15, 217, 0.33) - d21002 USING meters (groupdId) TAGS (2) VALUES ('2021-07-13 14:06:34.255', 10.15, 217, 0.33) - d21003 USING meters (groupdId) TAGS (2) (ts, current, phase) VALUES ('2021-07-13 14:06:34.255', 10.27, 0.31); + d21002 USING meters (groupId) TAGS (2) VALUES ('2021-07-13 14:06:34.255', 10.15, 217, 0.33) + d21003 USING meters (groupId) TAGS (2) (ts, current, phase) VALUES ('2021-07-13 14:06:34.255', 10.27, 0.31); ``` **说明:**在 2.0.20.5 版本之前,在使用自动建表语法并指定列时,子表的列名必须紧跟在子表名称后面,而不能如例子里那样放在 TAGS 和 VALUES 之间。从 2.0.20.5 版本开始,两种写法都可以,但不能在一条 SQL 语句中混用,否则会报语法错误。 diff --git a/documentation20/en/04.model/docs.md b/documentation20/en/04.model/docs.md index 5ab5e0c6a56d0b5d534386752988cb1adae3b2fa..2e69054fa12340cb0e264848d7def4b7685f8796 100644 --- a/documentation20/en/04.model/docs.md +++ b/documentation20/en/04.model/docs.md @@ -32,7 +32,7 @@ Replace the database operating in the current connection with “power”, other An IoT system often has many types of devices, such as smart meters, transformers, buses, switches, etc. for power grids. In order to facilitate aggregation among multiple tables, using TDengine, it is necessary to create a STable for each type of data collection point. Taking the smart meter in Table 1 as an example, you can use the following SQL command to create a STable: ```mysql -CREATE STABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupdId int); +CREATE STABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupId int); ``` **Note:** The STABLE keyword in this instruction needs to be written as TABLE in versions before 2.0.15. diff --git a/documentation20/en/07.advanced-features/docs.md b/documentation20/en/07.advanced-features/docs.md index cebbb4a269047b956359252bbdb71fb1a4ba8ff8..3a4d10375cf68456be054b4430d8a99a06ecdde5 100644 --- a/documentation20/en/07.advanced-features/docs.md +++ b/documentation20/en/07.advanced-features/docs.md @@ -17,7 +17,7 @@ The continuous query provided by TDengine differs from the time window calculati The following is an example of the smart meter scenario to introduce the specific use of continuous query. Suppose we create a STables and sub-tables through the following SQL statement: ```sql -create table meters (ts timestamp, current float, voltage int, phase float) tags (location binary(64), groupdId int); +create table meters (ts timestamp, current float, voltage int, phase float) tags (location binary(64), groupId int); create table D1001 using meters tags ("Beijing.Chaoyang", 2); create table D1002 using meters tags ("Beijing.Haidian", 2); ...