This is an automated email from the ASF dual-hosted git repository.

jiafengzheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 5d99abb3ec MOD: label with cte doc (#11661)
5d99abb3ec is described below

commit 5d99abb3ecaf108ac47929ad565ddf9e3fe133f5
Author: Stalary <stal...@163.com>
AuthorDate: Thu Aug 11 09:45:59 2022 +0800

    MOD: label with cte doc (#11661)
    
    insert label with cte doc
---
 docs/en/docs/data-operate/import/import-way/insert-into-manual.md  | 7 ++++++-
 .../docs/data-operate/import/import-way/insert-into-manual.md      | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/docs/en/docs/data-operate/import/import-way/insert-into-manual.md 
b/docs/en/docs/data-operate/import/import-way/insert-into-manual.md
index dceafb10c2..bd00cbb55c 100644
--- a/docs/en/docs/data-operate/import/import-way/insert-into-manual.md
+++ b/docs/en/docs/data-operate/import/import-way/insert-into-manual.md
@@ -46,7 +46,7 @@ INSERT INTO tbl2 WITH LABEL label1 SELECT * FROM tbl3;
 INSERT INTO tbl1 VALUES ("qweasdzxcqweasdzxc"), ("a");
 ```
 
-> Note: When you need to use `CTE(Common Table Expressions)` as the query part 
in an insert operation, you must specify the `WITH LABEL` and column list 
parts. Example:
+> Note: When you need to use `CTE(Common Table Expressions)` as the query part 
in an insert operation, you must specify the `WITH LABEL` and column list parts 
or wrap `CTE`. Example:
 >
 > ```sql
 > INSERT INTO tbl1 WITH LABEL label1
@@ -57,6 +57,11 @@ INSERT INTO tbl1 VALUES ("qweasdzxcqweasdzxc"), ("a");
 > INSERT INTO tbl1 (k1)
 > WITH cte1 AS (SELECT * FROM tbl1), cte2 AS (SELECT * FROM tbl2)
 > SELECT k1 FROM cte1 JOIN cte2 WHERE cte1.k1 = 1;
+> 
+> INSERT INTO tbl1 (k1)
+> select * from (
+> WITH cte1 AS (SELECT * FROM tbl1), cte2 AS (SELECT * FROM tbl2)
+> SELECT k1 FROM cte1 JOIN cte2 WHERE cte1.k1 = 1) as ret
 > ```
 
 For specific parameter description, you can refer to [INSERT 
INTO](../../../sql-manual/sql-reference/Data-Manipulation-Statements/Manipulation/INSERT.md)
 command or execute `HELP INSERT ` to see its help documentation for better use 
of this import method.
diff --git 
a/docs/zh-CN/docs/data-operate/import/import-way/insert-into-manual.md 
b/docs/zh-CN/docs/data-operate/import/import-way/insert-into-manual.md
index 5a42074327..198e79e02e 100644
--- a/docs/zh-CN/docs/data-operate/import/import-way/insert-into-manual.md
+++ b/docs/zh-CN/docs/data-operate/import/import-way/insert-into-manual.md
@@ -46,7 +46,7 @@ INSERT INTO tbl2 WITH LABEL label1 SELECT * FROM tbl3;
 INSERT INTO tbl1 VALUES ("qweasdzxcqweasdzxc"), ("a");
 ```
 
-> 注意:当需要使用 `CTE(Common Table Expressions)` 作为 insert 操作中的查询部分时,必须指定 `WITH 
LABEL` 和 column list 部分。示例:
+> 注意:当需要使用 `CTE(Common Table Expressions)` 作为 insert 操作中的查询部分时,必须指定 `WITH 
LABEL` 和 column list 部分或者对`CTE`进行包装。示例:
 >
 > ```sql
 > INSERT INTO tbl1 WITH LABEL label1
@@ -57,6 +57,11 @@ INSERT INTO tbl1 VALUES ("qweasdzxcqweasdzxc"), ("a");
 > INSERT INTO tbl1 (k1)
 > WITH cte1 AS (SELECT * FROM tbl1), cte2 AS (SELECT * FROM tbl2)
 > SELECT k1 FROM cte1 JOIN cte2 WHERE cte1.k1 = 1;
+>
+> INSERT INTO tbl1 (k1)
+> select * from (
+> WITH cte1 AS (SELECT * FROM tbl1), cte2 AS (SELECT * FROM tbl2)
+> SELECT k1 FROM cte1 JOIN cte2 WHERE cte1.k1 = 1) as ret
 > ```
 
 具体的参数说明,你可以参照 [INSERT 
INTO](../../../sql-manual/sql-reference/Data-Manipulation-Statements/Manipulation/INSERT.md)
 命令或者执行`HELP INSERT` 来查看其帮助文档以便更好的使用这种导入方式。


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to