Skip to content

Commit

Permalink
Fix WITH ebnf (pingcap#17053)
Browse files Browse the repository at this point in the history
  • Loading branch information
dveeden committed May 15, 2024
1 parent d30c9fb commit 6a05dbf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions sql-statements/sql-statement-with.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A Common Table Expression (CTE) is a temporary result set that can be referred m
```ebnf+diagram
WithClause ::=
"WITH" WithList
| "WITH" recursive WithList
| "WITH" "RECURSIVE" WithList
```

**WithList:**
Expand Down Expand Up @@ -43,10 +43,8 @@ IdentListWithParenOpt ::=

Non-recursive CTE:

{{< copyable "sql" >}}

```sql
WITH CTE AS (SELECT 1, 2) SELECT * FROM cte t1, cte t2;
WITH cte AS (SELECT 1, 2) SELECT * FROM cte t1, cte t2;
```

```
Expand All @@ -60,8 +58,6 @@ WITH CTE AS (SELECT 1, 2) SELECT * FROM cte t1, cte t2;

Recursive CTE:

{{< copyable "sql" >}}

```sql
WITH RECURSIVE cte(a) AS (SELECT 1 UNION SELECT a+1 FROM cte WHERE a < 5) SELECT * FROM cte;
```
Expand Down

0 comments on commit 6a05dbf

Please sign in to comment.