with as 的用法 ,哪位给解释下
WITH TEMP AS
(
SELECT id , ParentID
FROM Doc_Tree
WHERE id = @tree
UNION ALL
SELECT A.id , A.ParentID
FROM TEMP AS B JOIN Doc_Tree AS A ON A.ParentID = B.id
) with?as?
[解决办法]
你这个是递归吧..