您的位置:首页 > 数据库

sqlserver 2008 start with connect by 实现

2015-09-24 14:16 239 查看
with subqry(id,name,parent_id) as(
select id,name,parent_id from pro_type_manage where id in ('5799936','5799946') -- start with
union all
select test1.id,test1.name,test1.parent_id from pro_type_manage as test1,subqry
where test1.parent_id = subqry.id --connect by
)
select* from subqry;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: