Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/UserGuide/Master/Table/Basic-Concept/Write-Updata-Data.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ INSERT INTO <TABLE_NAME> [(COLUMN_NAME[, COLUMN_NAME]*)]? VALUES (COLUMN_VALUE[,
4. If a column value does not exist for the identified device, the insertion will overwrite any existing `null` values with the new data.
5. If a column value already exists for the identified device, a new insertion will update the column with the new value.
6. Writing duplicate timestamps will update the values in the columns corresponding to the original timestamps.
7. When an INSERT statement does not specify column names (e.g., INSERT INTO table VALUES (...)), the values in VALUES must strictly follow the physical order of columns in the table (this order can be checked via the DESC table command).

Since attributes generally do not change over time, it is recommended to update attribute values using the `UPDATE` statement described below,Please refer to the following [Data Update](#2-data-updates).

Expand Down Expand Up @@ -164,8 +165,8 @@ IoTDB supports inserting multiple rows of data in a single statement to improve
```SQL
insert into table1
values
('Frankfurt', '3001', '3', '1', '10', 4, 90.0, 1200.0)
('Frankfurt', '3001', '3', '1', '10', 5, 90.0, 1200.0)
(4, 'Frankfurt', '3001', '3', '1', '10', 90.0, 1200.0)
(5, 'Frankfurt', '3001', '3', '1', '10', 90.0, 1200.0)


insert into table1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ VALUES ('Hunan', '3001', '3', NULL, NULL, 5, 90.0, NULL);

```SQL
INSERT INTO table1 VALUES
('Beijing', '3001', '3', '1', '10', 4, 90.0, 1200.0),
('Beijing', '3001', '3', '1', '10', 5, 90.0, 1200.0);
(4, 'Beijing', '3001', '3', '1', '10', 90.0, 1200.0),
(5, 'Beijing', '3001', '3', '1', '10', 90.0, 1200.0);

INSERT INTO table1("Region", "PlantID", "DeviceID", Time, "Temperature", "Displacement")
VALUES
Expand Down
5 changes: 3 additions & 2 deletions src/UserGuide/latest-Table/Basic-Concept/Write-Updata-Data.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ INSERT INTO <TABLE_NAME> [(COLUMN_NAME[, COLUMN_NAME]*)]? VALUES (COLUMN_VALUE[,
4. If a column value does not exist for the identified device, the insertion will overwrite any existing `null` values with the new data.
5. If a column value already exists for the identified device, a new insertion will update the column with the new value.
6. Writing duplicate timestamps will update the values in the columns corresponding to the original timestamps.
7. When an INSERT statement does not specify column names (e.g., INSERT INTO table VALUES (...)), the values in VALUES must strictly follow the physical order of columns in the table (this order can be checked via the DESC table command).

Since attributes generally do not change over time, it is recommended to update attribute values using the `UPDATE` statement described below,Please refer to the following [Data Update](#2-data-updates).

Expand Down Expand Up @@ -164,8 +165,8 @@ IoTDB supports inserting multiple rows of data in a single statement to improve
```SQL
insert into table1
values
('Frankfurt', '3001', '3', '1', '10', 4, 90.0, 1200.0)
('Frankfurt', '3001', '3', '1', '10', 5, 90.0, 1200.0)
(4, 'Frankfurt', '3001', '3', '1', '10', 90.0, 1200.0)
(5, 'Frankfurt', '3001', '3', '1', '10', 90.0, 1200.0)


insert into table1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ VALUES ('Hunan', '3001', '3', NULL, NULL, 5, 90.0, NULL);

```SQL
INSERT INTO table1 VALUES
('Beijing', '3001', '3', '1', '10', 4, 90.0, 1200.0),
('Beijing', '3001', '3', '1', '10', 5, 90.0, 1200.0);
(4, 'Beijing', '3001', '3', '1', '10', 90.0, 1200.0),
(5, 'Beijing', '3001', '3', '1', '10', 90.0, 1200.0);

INSERT INTO table1("Region", "PlantID", "DeviceID", Time, "Temperature", "Displacement")
VALUES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ INSERT INTO <TABLE_NAME> [(COLUMN_NAME[, COLUMN_NAME]*)]? VALUES (COLUMN_VALUE[,
4. 若当前设备(由标识信息定位)不存在该属性列的值,执行写入操作将导致原有的空值(NULL)被写入的数据所替代。
5. 若当前设备(由标识信息定位)已有属性列的值,再次写入相同的属性列时,系统将更新该属性列的值为新数据。
6. 写入重复时间戳,原时间戳对应列的值会更新。
7. 若 INSERT 语句未指定列名(如 INSERT INTO table VALUES (...)),则 VALUES中的值必须严格按表中列的物理顺序排列(顺序可通过 DESC table命令查看)。

由于属性一般并不随时间的变化而变化,因此推荐以 update 的方式单独更新属性值,参见下文 [数据更新](#数据更新)。

Expand Down Expand Up @@ -162,8 +163,8 @@ insert into table1("地区", "厂号", "设备号", "型号", "维修周期", Ti
```SQL
insert into table1
values
('北京', '3001', '3', '1', '10', 4, 90.0, 1200.0),
('北京', '3001', '3', '1', '10', 5, 90.0, 1200.0);
(4, '北京', '3001', '3', '1', '10', 90.0, 1200.0),
(5, '北京', '3001', '3', '1', '10', 90.0, 1200.0);


insert into table1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ insert into table1("地区", "厂号", "设备号", "型号", "维修周期", Ti
```SQL
insert into table1
values
('北京', '3001', '3', '1', '10', 4, 90.0, 1200.0),
('北京', '3001', '3', '1', '10', 5, 90.0, 1200.0);
(4, '北京', '3001', '3', '1', '10', 90.0, 1200.0),
(5, '北京', '3001', '3', '1', '10', 90.0, 1200.0);

insert into table1
("地区", "厂号", "设备号", Time, "温度", "排量")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ INSERT INTO <TABLE_NAME> [(COLUMN_NAME[, COLUMN_NAME]*)]? VALUES (COLUMN_VALUE[,
4. 若当前设备(由标识信息定位)不存在该属性列的值,执行写入操作将导致原有的空值(NULL)被写入的数据所替代。
5. 若当前设备(由标识信息定位)已有属性列的值,再次写入相同的属性列时,系统将更新该属性列的值为新数据。
6. 写入重复时间戳,原时间戳对应列的值会更新。
7. 若 INSERT 语句未指定列名(如 INSERT INTO table VALUES (...)),则 VALUES中的值必须严格按表中列的物理顺序排列(顺序可通过 DESC table命令查看)。

由于属性一般并不随时间的变化而变化,因此推荐以 update 的方式单独更新属性值,参见下文 [数据更新](#数据更新)。

Expand Down Expand Up @@ -162,8 +163,8 @@ insert into table1("地区", "厂号", "设备号", "型号", "维修周期", Ti
```SQL
insert into table1
values
('北京', '3001', '3', '1', '10', 4, 90.0, 1200.0),
('北京', '3001', '3', '1', '10', 5, 90.0, 1200.0);
(4, 北京', '3001', '3', '1', '10', 90.0, 1200.0),
(5, 北京', '3001', '3', '1', '10', 90.0, 1200.0);


insert into table1
Expand All @@ -176,7 +177,7 @@ values
#### 注意事项

- 如果在 SQL 语句中引用了表中不存在的列,IoTDB 将返回错误码 `COLUMN_NOT_EXIST(616)`。
- 如果写入的数据类型与表中列的数据类型不一致,将报错 `DATA_TYPE_MISMATCH(507)`。
- 如果写入的数据类型与表中列的数据类型不一致,将报错 `DATA_TYPE_MISMATCH(507)`。

## 2. 数据更新

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ insert into table1("地区", "厂号", "设备号", "型号", "维修周期", Ti
```SQL
insert into table1
values
('北京', '3001', '3', '1', '10', 4, 90.0, 1200.0),
('北京', '3001', '3', '1', '10', 5, 90.0, 1200.0);
(4, '北京', '3001', '3', '1', '10', 90.0, 1200.0),
(5, '北京', '3001', '3', '1', '10', 90.0, 1200.0);

insert into table1
("地区", "厂号", "设备号", Time, "温度", "排量")
Expand Down