Table 'cte_child' doesn't exist 谁能帮我解答一下,我看网上是这样写的,但是我一查就这样,不太理解

WITH cte_child (id, title, parent, level)
AS (

SELECT id,
title,
parent,
0 AS level
FROM tb_menu
WHERE id = 6
UNION ALL

SELECT a.id,
a.title,
a.parent,
b.level + 1
FROM tb_menu a
INNER JOIN cte_child b
ON (a.parent = b.id)
)
SELECT *
FROM cte_child;

test.tree是指test数据库的tree表,确认是否准确;数据库名称可以省略的。

确定sql沾对了么 ,哪里用到test.tree表了

test.tree不存在,可是你确定是这段sql的问题?