while @@rowcount>0
就是上一条(执行次序上的上一条,可能是循环的最后一条)语句有影响的行数,或者说影响的行数大于0这里的上一条可能是:insert @re select @id,@l,@num     --第一次或者                              --其他
insert @re select a.子,@l,num=b.num*a.值          
from 表 a join @re b on a.父=b.id
where b.level=@l-1