with t as(select * from category where categoryid = 1 union all select category.* from t, category where t.categoryid = category.parentid ) select * from t
with t as(select * from category where categoryid = 1 union all select category.* from t, category where t.categoryid = category.parentid ) select * from t
转载于:https://www.cnblogs.com/NigelShi/p/5611493.html