File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
docs/doc/14-sql-commands/20-query-syntax Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -35,21 +35,20 @@ ORDER BY customername;
3535## Syntax
3636
3737``` sql
38- WITH cte_name1 [(col_name [, col_name] ...)] AS (subquery1)
39- [, cte_name2 [(col_name [, col_name] ...)] AS (subquery2)]
40- [...]
38+ WITH
39+ < cte_name1> [ ( < cte_column_list> ) ] AS ( SELECT ... )
40+ [ , < cte_name2> [ ( < cte_column_list> ) ] AS ( SELECT ... ) ]
41+ [ , < cte_nameN> [ ( < cte_column_list> ) ] AS ( SELECT ... ) ]
4142SELECT ...
4243```
4344
4445Where:
4546
4647` WITH ` : Initiates the WITH clause.
4748
48- ` cte_name1 ` : Specifies the name of the first result set.
49+ ` < cte_name1>, <cte_nameN> ` : The CTE name.
4950
50- ` subquery1 ` : Defines the first result set.
51-
52- ` cte_name2 AS (subquery2) ` : You can define multiple CTEs in a WITH clause.
51+ ` <cte_column_list> ` : The names of the columns in the CTE.
5352
5453- A CTE can refer to any CTEs in the same WITH clause that are defined before.
5554
You can’t perform that action at this time.
0 commit comments