li.的博客
li.的首页 > li.的博客 > 浏览文章

SQLSERVER2005/2008/2012的递归查询(无限级)

分类:sql server  人气:640  评论:0  时间:2015-05-02 20:40
with tmpTable as (
select * from [table] Where id = 1
union all
select [table].*
from tmpTable inner join [table] on tmpTable.id=[table].pid
)
select * from tmpTable
标签(Tag):sqlserver 递归 无限级
评论(0)
暂无评论
我来评论
(800字以内)