MySQL实现上下级关联的方法简介MySQL上下关联答:递归查询可以使用MySQL中的WITH RECURSIVE语句:WITH RECURSIVE cte AS (SELECT id, name, parent_id, lft, rgt, depth FROM categories WHERE id = ?UNION ALL SELECT categories.id, categories.name, categories.parent_id, categories.lft, categories.rgt, categories.depth FROM categories, cte WH...