From b952308c8e218ab1524e0bdc12feca2827fe38c1 Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Fri, 15 Apr 2022 18:13:12 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20delete=E8=AF=AD=E6=B3=95=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reference-guide/sql-syntax/74-DELETE.md | 11 ++++---- .../reference-guide/sql-syntax/74-DELETE.md | 25 +++++++++++-------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/product/en/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md b/product/en/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md index bf19c08e..f466f629 100644 --- a/product/en/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md +++ b/product/en/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md @@ -20,7 +20,7 @@ date: 2021-05-10 ```ebnf+diagram Delete ::= [ WITH [ RECURSIVE ] with_query [, ...] ] -DELETE [/*+ plan_hint */] FROM [ ONLY ] table_name [ * ] [ [ AS ] alias ] +DELETE [/*+ plan_hint */] [ FROM ] [ ONLY ] table_name [ * ] [ [ AS ] alias ] [ USING using_list ] [ WHERE condition | WHERE CURRENT OF cursor_name ] [ RETURNING { * | { output_expr [ [ AS ] output_name ] } [, ...] } ]; @@ -36,16 +36,15 @@ DELETE [/*+ plan_hint */] FROM [ ONLY ] table_name [ * ] [ [ AS ] alias ] Format of **with_query**: - ```sql - with_query_name [ ( column_name [, ...] ) ] AS - + ```ebnf+diagram + with_query_name ::= with_query_name [ ( column_name [, …] ) ] AS ( {select | values | insert | update | delete} ) ``` - + - **with_query_name** specifies the name of the result set generated by a subquery. Such names can be used to access the subquery result set. - **column_name** specifies the column name displayed in the subquery result set. - Each subquery can be a **SELECT**, **VALUES**, **INSERT**, **UPDATE** or **DELETE** statement. - + - **plan_hint** clause Follows the **DELETE** keyword in the **/\*+ \*/** format. It is used to optimize the plan of a **DELETE** statement block. For details, see [Hint-based Tuning](9-hint-based-tuning). In each statement, only the first **/\*+** _plan_hint _***/** comment block takes effect as a hint. Multiple hints can be written. diff --git a/product/zh/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md b/product/zh/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md index 95faa18e..25f139d9 100644 --- a/product/zh/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md +++ b/product/zh/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md @@ -1,8 +1,8 @@ --- title: DELETE summary: DELETE -author: Zhang Cuiping -date: 2021-05-10 +author: GUO HUAN +date: 2022-04-15 --- # DELETE @@ -20,7 +20,7 @@ DELETE从指定的表里删除满足WHERE子句的行。如果WHERE子句不存 ```ebnf+diagram Delete ::= [ WITH [ RECURSIVE ] with_query [, ...] ] -DELETE FROM [ ONLY ] table_name [ * ] [ [ AS ] alias ] +DELETE [/*+ plan_hint */] [ FROM ] [ ONLY ] table_name [ * ] [ [ AS ] alias ] [ USING using_list ] [ WHERE condition | WHERE CURRENT OF cursor_name ] [ RETURNING { * | { output_expr [ [ AS ] output_name ] } [, ...] } ]; @@ -30,22 +30,25 @@ DELETE FROM [ ONLY ] table_name [ * ] [ [ AS ] alias ] - **WITH [ RECURSIVE ] with_query [, …]** - 用于声明一个或多个可以在主查询中通过名称引用的子查询,相当于临时表。 + 用于声明一个或多个可以在主查询中通过名称引用的子查询,相当于临时表。 - 如果声明了RECURSIVE,那么允许SELECT子查询通过名称引用它自己。 + 如果声明了RECURSIVE,那么允许SELECT子查询通过名称引用它自己。 - 其中with_query的详细格式为: + 其中with_query的详细格式为: - with_query_name [ ( column_name [, …] ) ] AS - - ( {select | values | insert | update | delete} ) + ```ebnf+diagram + with_query_name ::= with_query_name [ ( column_name [, …] ) ] AS + ( {select | values | insert | update | delete} ) + ``` - with_query_name指定子查询生成的结果集名称,在查询中可使用该名称访问子查询的结果集。 - - column_name指定子查询结果集中显示的列名。 - - 每个子查询可以是SELECT,VALUES,INSERT,UPDATE或DELETE语句。 +- **plan_hint子句** + + 以/\*+ \*/的形式在DELETE关键字后,用于对DELETE对应的语句块生成的计划进行hint调优,详细用法请参见章节[使用Plan Hint进行调优](9-hint-based-tuning)。每条语句中只有第一个/*+ plan_hint */注释块会作为hint生效,里面可以写多条hint。 + - **ONLY** 如果指定ONLY则只有该表被删除;如果没有声明,则该表和它的所有子表将都被删除。 -- Gitee From 7f8b66588c390a9c50d3b102619e54095ecb5333 Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Fri, 15 Apr 2022 20:45:03 +0800 Subject: [PATCH 2/3] fix markdown --- .../zh/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product/zh/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md b/product/zh/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md index 25f139d9..e6720dcf 100644 --- a/product/zh/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md +++ b/product/zh/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md @@ -47,7 +47,7 @@ DELETE [/*+ plan_hint */] [ FROM ] [ ONLY ] table_name [ * ] [ [ AS ] alias ] - **plan_hint子句** - 以/\*+ \*/的形式在DELETE关键字后,用于对DELETE对应的语句块生成的计划进行hint调优,详细用法请参见章节[使用Plan Hint进行调优](9-hint-based-tuning)。每条语句中只有第一个/*+ plan_hint */注释块会作为hint生效,里面可以写多条hint。 + 以`/*+ */`的形式在DELETE关键字后,用于对DELETE对应的语句块生成的计划进行hint调优,详细用法请参见章节[使用Plan Hint进行调优](9-hint-based-tuning)。每条语句中只有第一个`/*+ plan_hint */`注释块会作为hint生效,里面可以写多条hint。 - **ONLY** -- Gitee From 491cb7d04b865b0292f0033bf9d6eb8078d92dc4 Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Fri, 15 Apr 2022 21:59:13 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix=20=E8=BD=A8=E9=81=93=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../en/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md | 2 +- .../zh/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/product/en/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md b/product/en/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md index f466f629..14b6e177 100644 --- a/product/en/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md +++ b/product/en/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md @@ -37,7 +37,7 @@ DELETE [/*+ plan_hint */] [ FROM ] [ ONLY ] table_name [ * ] [ [ AS ] alias ] Format of **with_query**: ```ebnf+diagram - with_query_name ::= with_query_name [ ( column_name [, …] ) ] AS + with_query_name ::= with_query_name [ ( column_name [, ...] ) ] AS ( {select | values | insert | update | delete} ) ``` diff --git a/product/zh/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md b/product/zh/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md index e6720dcf..1c9b230e 100644 --- a/product/zh/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md +++ b/product/zh/docs-mogdb/v2.1/reference-guide/sql-syntax/74-DELETE.md @@ -37,7 +37,7 @@ DELETE [/*+ plan_hint */] [ FROM ] [ ONLY ] table_name [ * ] [ [ AS ] alias ] 其中with_query的详细格式为: ```ebnf+diagram - with_query_name ::= with_query_name [ ( column_name [, …] ) ] AS + with_query_name ::= with_query_name [ ( column_name [, ...] ) ] AS ( {select | values | insert | update | delete} ) ``` -- Gitee