This is an automated email from the ASF dual-hosted git repository.
kassiez pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push:
new f48fa0a87f1 [fix](cte) clause's translation is not correct in chinese
doc (#1694)
f48fa0a87f1 is described below
commit f48fa0a87f19203227bd454338e187b36cf122ef
Author: morrySnow <[email protected]>
AuthorDate: Thu Jan 2 11:11:12 2025 +0800
[fix](cte) clause's translation is not correct in chinese doc (#1694)
## Versions
- [x] dev
- [x] 3.0
- [x] 2.1
- [ ] 2.0
## Languages
- [x] Chinese
- [ ] English
## Docs Checklist
- [ ] Checked by AI
- [ ] Test Cases Built
---
.../current/query-data/cte.md | 2 +-
.../version-2.0/query/query-data/cte.md | 28 +++++++++++++++++++---
.../version-2.1/query-data/cte.md | 2 +-
.../version-3.0/query-data/cte.md | 2 +-
4 files changed, 28 insertions(+), 6 deletions(-)
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-data/cte.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-data/cte.md
index da6810711c2..94da2aade2a 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-data/cte.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-data/cte.md
@@ -28,7 +28,7 @@ under the License.
公用表表达式(Common Table Expression)定义一个临时结果集,你可以在 SQL 语句的范围内多次引用。CTE 主要用于 SELECT
语句中。
-要指定公用表表达式,请使用 `WITH` 具有一个或多个逗号分隔子句的子句。每个子条款都提供一个子查询,用于生成结果集,并将名称与子查询相关联。
+要指定公用表表达式,请使用 `WITH` 具有一个或多个逗号分隔子句的子句。每个子句都提供一个子查询,用于生成结果集,并将名称与子查询相关联。
Doris 支持嵌套 CTE。在包含该 `WITH`子句 的语句中,可以引用每个 CTE 名称以访问相应的 CTE 结果集。CTE 名称可以在其他 CTE
中引用,从而可以基于其他 CTE 定义 CTE。
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/query/query-data/cte.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/query/query-data/cte.md
index e78a1c09a5c..94da2aade2a 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/query/query-data/cte.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/query/query-data/cte.md
@@ -28,14 +28,16 @@ under the License.
公用表表达式(Common Table Expression)定义一个临时结果集,你可以在 SQL 语句的范围内多次引用。CTE 主要用于 SELECT
语句中。
-要指定公用表表达式,请使用 `WITH` 具有一个或多个逗号分隔子句的子句。每个子条款都提供一个子查询,用于生成结果集,并将名称与子查询相关联。
+要指定公用表表达式,请使用 `WITH` 具有一个或多个逗号分隔子句的子句。每个子句都提供一个子查询,用于生成结果集,并将名称与子查询相关联。
-在包含该 `WITH`子句 的语句中,可以引用每个 CTE 名称以访问相应的 CTE 结果集。CTE 名称可以在其他 CTE 中引用,从而可以基于其他
CTE 定义 CTE。
+Doris 支持嵌套 CTE。在包含该 `WITH`子句 的语句中,可以引用每个 CTE 名称以访问相应的 CTE 结果集。CTE 名称可以在其他 CTE
中引用,从而可以基于其他 CTE 定义 CTE。
-Doris **不支持** 递归 CTE。
+Doris **不支持** 递归 CTE。有关递归 CTE 的详细解释,可以参考 [MySQL 递归 CTE
手册](https://dev.mysql.com/doc/refman/8.4/en/with.html#common-table-expressions-recursive)
## 示例
+### 简单示例
+
下面的示例定义名为的 CTE `cte1` 和 `cte2` 中 `WITH` 子句,并且是指在它们的顶层 `SELECT` 下面的 `WITH` 子句:
```sql
@@ -45,3 +47,23 @@ WITH
SELECT b,d FROM cte1 JOIN cte2
WHERE cte1.a = cte2.c;
```
+
+### 嵌套 CTE
+
+```sql
+WITH
+ cte1 AS (SELECT a, b FROM table1),
+ cte2 AS (SELECT c, d FROM cte1)
+SELECT b, d FROM cte1 JOIN cte2
+WHERE cte1.a = cte2.c;
+```
+
+### 递归 CTE (Doris 不支持)
+
+```sql
+WITH r_cte AS (
+ SELECT 1 AS user_id, 2 as manager_id
+ UNION ALL
+ SELECT user_id, manager_id FROM r_cte INNER JOIN (SELECT 1 AS user_id, 2 as
manager_id) t ON r_cte.manager_id = t.user_id
+)
+SELECT * FROM r_cte
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/query-data/cte.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/query-data/cte.md
index da6810711c2..94da2aade2a 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/query-data/cte.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/query-data/cte.md
@@ -28,7 +28,7 @@ under the License.
公用表表达式(Common Table Expression)定义一个临时结果集,你可以在 SQL 语句的范围内多次引用。CTE 主要用于 SELECT
语句中。
-要指定公用表表达式,请使用 `WITH` 具有一个或多个逗号分隔子句的子句。每个子条款都提供一个子查询,用于生成结果集,并将名称与子查询相关联。
+要指定公用表表达式,请使用 `WITH` 具有一个或多个逗号分隔子句的子句。每个子句都提供一个子查询,用于生成结果集,并将名称与子查询相关联。
Doris 支持嵌套 CTE。在包含该 `WITH`子句 的语句中,可以引用每个 CTE 名称以访问相应的 CTE 结果集。CTE 名称可以在其他 CTE
中引用,从而可以基于其他 CTE 定义 CTE。
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/query-data/cte.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/query-data/cte.md
index da6810711c2..94da2aade2a 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/query-data/cte.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/query-data/cte.md
@@ -28,7 +28,7 @@ under the License.
公用表表达式(Common Table Expression)定义一个临时结果集,你可以在 SQL 语句的范围内多次引用。CTE 主要用于 SELECT
语句中。
-要指定公用表表达式,请使用 `WITH` 具有一个或多个逗号分隔子句的子句。每个子条款都提供一个子查询,用于生成结果集,并将名称与子查询相关联。
+要指定公用表表达式,请使用 `WITH` 具有一个或多个逗号分隔子句的子句。每个子句都提供一个子查询,用于生成结果集,并将名称与子查询相关联。
Doris 支持嵌套 CTE。在包含该 `WITH`子句 的语句中,可以引用每个 CTE 名称以访问相应的 CTE 结果集。CTE 名称可以在其他 CTE
中引用,从而可以基于其他 CTE 定义 CTE。
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]