treeview循环查询 [英] treeview looping query

查看:63
本文介绍了treeview循环查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设计了一个树视图结构如下:

* parentID = 0表示树根

i have designed a treeview structure as below:
*parentID = 0 means tree root

ID    parentID
1        0
2        0
3        1
4        1
5        1
6        3
7        4
8        5
9        5
10       5
11       2
12       2
13       10



当我传递参数1 它将在Root1下返回所有内容的结果:


When i pass the parameter of "1" it will return the result of everything under Root "1":

ID    parentID
1        0
3        1
4        1
5        1
6        3
7        4
8        5
9        5
10       5
13       10



任何人都知道如何建立这个查询?


anyone have an idea how to build this query?

推荐答案

试试这个

http://stackoverflow.com/questions/9004543/recursive-child-parent-queries-in-t- sql [ ^ ]


这篇关于treeview循环查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆