例如:
Select * From (
WITH RECURSIVE cte_name AS (
initial_query -- anchor member
UNION ALL
recursive_query -- recursive member that references to the CTE name
)
SELECT * FROM cte_name
) A
例如:
Select * From (
WITH RECURSIVE cte_name AS (
initial_query -- anchor member
UNION ALL
recursive_query -- recursive member that references to the CTE name
)
SELECT * FROM cte_name
) A
1条答案
按热度按时间ncgqoxb01#
mysql 8.0参考手册的第13.2.13节介绍了常用表表达式的语法,其中提到了以下内容:
在以下上下文中允许with子句:在子查询(包括派生表子查询)的开头:
所以,这澄清了我的问题,因此把我自己的答案作为一个社区wiki。