sql server 遍历表成一棵树结构
摘要:
一棵树的层次结构都在一张表内,当有这样的需要的时候。。可以这样玩: with ldepartment as ( select dept_id, parent_id, 0 as dept_level, row_number()over(order by getdate()) as orderid from department where ( parent_id is null or parent_id = '' ) union all select a.dept_id, ... 阅读全文
posted @ 2013-12-02 13:26 陈惟鲜的博客 阅读(909) 评论(0) 推荐(0) 编辑