∏三毛

昔者庄周梦为胡蝶,栩栩然胡蝶也。自喻适志与!不知周也。

俄然觉,则蘧蘧然周也。不知周之梦为胡蝶与?胡蝶之梦为周与?

周与胡蝶则必有分矣。此之谓‘物化’。

USE AdventureWorks ;
GO
WITH DirectReports(LoginID, ManagerID, EmployeeID) AS
(
    SELECT LoginID, ManagerID, EmployeeID
    FROM HumanResources.Employee
    WHERE ManagerID IS NULL
    UNION ALL
    SELECT e.LoginID, e.ManagerID, e.EmployeeID
    FROM HumanResources.Employee e
    INNER JOIN DirectReports d
    ON e.ManagerID = d.EmployeeID
)
SELECT *
FROM DirectReports;
OPTION (MAXRECURSION 3);
posted on 2009-12-10 14:29  π三毛  阅读(296)  评论(0编辑  收藏  举报