函数定义完,下面就应该和 icevi(按钮工厂) 同志的答案异曲同工、不谋而和了 */ select id,dbo.GetAllAncestors(id) ,(select count(*) from T where '-' + dbo.GetAllAncestors(f1) + '-' like '%-' + cast(tree.id as varchar) + '-%') from tree select id,dbo.Get32Ancestors(id) ,(select count(*) from T where '-' + dbo.Get32Ancestors(f1) + '-' like '%-' + cast(tree.id as varchar) + '-%') from tree /* 另外还要说一下封装的程度的问题,具体情况具体分析, 本题就不适合定义函数直接得到最终结果! 以上答案仅供参考!! 欢迎继续参与讨论! */
数据载入中...
页码:[1] [2] [3] [4] [5] [6] [7] [8] 第7页、共8页 |