以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  cte递归查询的结果如果加在查询中间怎么写  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=101256)

--  作者:happyft
--  发布时间:2017/5/27 11:29:00
--  cte递归查询的结果如果加在查询中间怎么写
一个cte递归查询得到一个临时表,再与另外一个表left join得到数据,要查询最终的数据,中间cte与前面sql语句及后面另外一个表的连接处要怎么写?

se lect * from

(
with cte as
....

se lect * from cte
)  B

left join  表A
where ....

中间红色部份与上下两边连接要怎么写,总不对,谢谢!

--  作者:有点蓝
--  发布时间:2017/5/27 11:58:00
--  
with cte as
....

se lect * from cte  left join  表A
where ....

http://www.cnblogs.com/fygh/archive/2011/08/31/2160266.html

--  作者:HappyFt
--  发布时间:2017/5/27 12:13:00
--  
看来只以放在前面了,原来是想放在中间.