mysql函數(shù)實(shí)現(xiàn)遞歸查詢,函數(shù)參數(shù)能不能當(dāng)表名
1 回答

喵喔喔
TA貢獻(xiàn)1735條經(jīng)驗(yàn) 獲得超5個(gè)贊
with a as
(select * from table1 where parentid=0
union all
select b.* from a,table1 b where a.id=b.parentid)
select * from a
用with as 來(lái)實(shí)現(xiàn)遞歸
添加回答
舉報(bào)
0/150
提交
取消