求一条SQL语句的写法。 数据库表A和B,都为无限递归结构(id,Pid,name),现在任意选中A表的一条记录,如何将该记录及其所有子记录全部插到B表中? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ;with t as(select *,id name from tb where parentid=0union allselect tb.*,t.name from tb,t where tb.parentid=t.id)http://topic.csdn.net/u/20070727/18/91ED52D2-E6F4-4179-8367-DBD7B95237A9.html Insert into B (Pid,name) Select Pid,name From A Where Pid=@id ;with tempdb as(select * from a where id=1union allselect a.* from a join tempdb b on a.pid=b.id)select * from tempdb ListView刷新 找不到数据库服务器 AjaxPro有没有支持.NET 3.5的DLL版本? datagrid里面放个label 怎样去调用这段代码? 紧急求助!!!文章分页,却显示为HTML格式,图片显示不出来!! ASP.net 有进度上传文件,有进度操作数据库开放源码只差最后一个问题 我是一个c#菜鸟,求救 一个报表的小问题,不胜感激~ 如何感知用户的操作? Request.QueryString["id"];丢失怎么办? 进来看下~
(
select *,id name from tb where parentid=0
union all
select tb.*,t.name from tb,t where tb.parentid=t.id
)
http://topic.csdn.net/u/20070727/18/91ED52D2-E6F4-4179-8367-DBD7B95237A9.html
Select Pid,name
From A
Where Pid=@id
(
select * from a where id=1
union all
select a.* from a join tempdb b on a.pid=b.id
)
select * from tempdb