摘要:
create function f_id( @id int --要查询的id )returns @re table(id int,level int) as begin declare @l int set @l=0 insert @re select id,@l from 表 where 上级id=@id while @@rowcount> 0 begin set @l=@l+1 insert @re select a.id,@l from 表 a join @re b on a.... 阅读全文
posted @ 2013-01-21 15:08
Rich.T
阅读(137)
评论(0)
推荐(0)
浙公网安备 33010602011771号