Skip to content

Commit

Permalink
docs: update delete docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dl239 committed Jun 19, 2023
1 parent 4d5ef46 commit 3640df8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 6 additions & 2 deletions docs/en/reference/sql/dml/DELETE_STATEMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ TableName ::=
**Description**

- `DELETE` statement will delete all data from the index of specific column value of online table.
- The filter columns sepcified by `WHERE` must be an index column and the condition can only be `=`.
- The filter columns sepcified by `WHERE` must be an index column. if it is a key column, only `=` can be used.

## Examples

```SQL
DELETE FROM t1 WHERE col1 = 'aaaa';

DELETE FROM t1 WHERE col1 = 'aaaa' and col2 = 'bbbb';
DELETE FROM t1 WHERE col1 = 'aaaa' and ts_col = 1687145994000;

DELETE FROM t1 WHERE col1 = 'aaaa' and ts_col > 1687059594000 and ts_col < 1687145994000;

DELETE FROM t1 WHERE ts_col > 1687059594000 and ts_col < 1687145994000;
```
10 changes: 7 additions & 3 deletions docs/zh/openmldb_sql/dml/DELETE_STATEMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ TableName ::=

**说明**

- `DELETE` 语句删除在线表指定列的索引下面对应值的所有数据
- `WHERE` 指定的筛选列必须是索引列并且只能是等于
- `DELETE` 语句删除在线表满足指定条件的数据
- `WHERE` 指定的筛选列必须是索引列。如果是key列只能用等于

## Examples

```SQL
DELETE FROM t1 WHERE col1 = 'aaaa';

DELETE FROM t1 WHERE col1 = 'aaaa' and col2 = 'bbbb';
DELETE FROM t1 WHERE col1 = 'aaaa' and ts_col = 1687145994000;

DELETE FROM t1 WHERE col1 = 'aaaa' and ts_col > 1687059594000 and ts_col < 1687145994000;

DELETE FROM t1 WHERE ts_col > 1687059594000 and ts_col < 1687145994000;
```

0 comments on commit 3640df8

Please sign in to comment.