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
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ INSERT INTO table1(region, plant_id, device_id, time, temperature) VALUES ('北

标签列、属性列和测点列可以指定空值(`null`),表示不写入任何内容。

**示例(与上述事例等价):**
**示例(与上述示例等价):**

```SQL
# 上述部分列写入等价于如下的带空值写入
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ INSERT INTO table1(region, plant_id, device_id, time, temperature) VALUES ('北

标签列、属性列和测点列可以指定空值(`null`),表示不写入任何内容。

**示例(与上述事例等价):**
**示例(与上述示例等价):**

```SQL
# 上述部分列写入等价于如下的带空值写入
Expand Down Expand Up @@ -367,28 +367,3 @@ updateAssignment
```SQL
update table1 set b = a where substring(a, 1, 1) like '%'
```

## 2. 数据更新

### 2.1 语法

```SQL
UPDATE <TABLE_NAME> SET updateAssignment (',' updateAssignment)* (WHERE where=booleanExpression)?

updateAssignment
: identifier EQ expression
;
```

1. `update`语句仅允许修改属性(ATTRIBUTE)列的值。
2. `WHERE` 的规则:
- 范围仅限于标签列(TAG)和属性列(ATTRIBUTE),不允许涉及测点列(FIELD)和时间列(TIME)。
- 不允许使用聚合函数
3. 执行 SET 操作后,赋值表达式的结果应当是字符串类型,且其使用的限制应与 WHERE 子句中的表达式相同。
4. 属性(ATTRIBUTE)列以及测点(FIELD)列的值也可通过`insert`语句来实现指定行的更新。

**示例:**

```SQL
update table1 set b = a where substring(a, 1, 1) like '%'
```
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ INSERT INTO table1(region, plant_id, device_id, time, temperature) VALUES ('北

标签列、属性列和测点列可以指定空值(`null`),表示不写入任何内容。

**示例(与上述事例等价):**
**示例(与上述示例等价):**

```SQL
# 上述部分列写入等价于如下的带空值写入
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ INSERT INTO table1(region, plant_id, device_id, time, temperature) VALUES ('北

标签列、属性列和测点列可以指定空值(`null`),表示不写入任何内容。

**示例(与上述事例等价):**
**示例(与上述示例等价):**

```SQL
# 上述部分列写入等价于如下的带空值写入
Expand Down Expand Up @@ -367,28 +367,3 @@ updateAssignment
```SQL
update table1 set b = a where substring(a, 1, 1) like '%'
```

## 2. 数据更新

### 2.1 语法

```SQL
UPDATE <TABLE_NAME> SET updateAssignment (',' updateAssignment)* (WHERE where=booleanExpression)?

updateAssignment
: identifier EQ expression
;
```

1. `update`语句仅允许修改属性(ATTRIBUTE)列的值。
2. `WHERE` 的规则:
- 范围仅限于标签列(TAG)和属性列(ATTRIBUTE),不允许涉及测点列(FIELD)和时间列(TIME)。
- 不允许使用聚合函数
3. 执行 SET 操作后,赋值表达式的结果应当是字符串类型,且其使用的限制应与 WHERE 子句中的表达式相同。
4. 属性(ATTRIBUTE)列以及测点(FIELD)列的值也可通过`insert`语句来实现指定行的更新。

**示例:**

```SQL
update table1 set b = a where substring(a, 1, 1) like '%'
```
Loading