时间:2021-07-01 10:21:17 帮助过:21人阅读
WITH RECURSIVE result (
id,
GoodsTypeName,
parentid
) AS (
SELECT
id,
GoodsTypeName,
parentid
FROM
goodstype
WHERE
id = 2
UNION ALL
SELECT
i.id,
i.GoodsTypeName,
i.parentid
FROM
goodstype i
JOIN result ON i.parentid = result.id
) SELECT
*
FROM
result
my sql 查找父类下面的所有子类
标签:mini admin 子类 png str pen appdata img min