sql 树节点遍历查询

select mt.id from category mt
		    where 1=1
		    start with mt.id = ${id} 
		    connect by nocycle prior mt.id = mt.pid

mt.id = mt.pid 向下查找树节点
mt.pid = mt.id 向上查找树节点
发布了13 篇原创文章 · 获赞 2 · 访问量 482

猜你喜欢

转载自blog.csdn.net/m_crayon/article/details/103469413