select * from
(Select distinct name,categoryId,parentid,sort_order From shop_category START WITH parentid IS NULL
Connect by parentid = prior categoryId order by sort_order)
Start with parentid IS NULL Connect by parentid = prior categoryId
(Select distinct name,categoryId,parentid,sort_order From shop_category START WITH parentid IS NULL
Connect by parentid = prior categoryId order by sort_order)
Start with parentid IS NULL Connect by parentid = prior categoryId
本文介绍了一种使用SQL进行复杂树状结构查询的方法,通过WITH和CONNECT BY语法实现对商品分类数据的层级展示,确保数据按特定顺序排列。
1941

被折叠的 条评论
为什么被折叠?



