摘要: --建立測試環境Create Table A(IDInt,fatherIDInt,NameVarchar(10))Insert A Select 1, NULL, 'tt'Union All Select 2, 1, 'aa'Union All Select 3, 1, 'bb'Union All Select 4, 2, 'cc'Union All Select 5, 2, 'gg'Union ... 阅读全文
posted @ 2009-05-11 07:08 awp110 阅读(1730) 评论(2) 推荐(0) 编辑
摘要: 函数CREATE FUNCTION GetChildren (@id varchar(20))RETURNS @t table(id varchar(20)) AS BEGIN insert @t select subid from tree where parentid = @id while @@rowcount > 0 insert @t select a.subid from tr... 阅读全文
posted @ 2009-05-11 07:03 awp110 阅读(456) 评论(0) 推荐(0) 编辑