如何在sqlserver实现oracle中START WITH id = '' CONNECT BY PRIOR id=p_id语句
--oracle中的 START WITH id = '' CONNECT BY PRIOR id=p_id 如何在sqlserver中实现呢。最好的解决办法:WITH NODES AS ( SELECT * FROM DBO.T_ADMIN_RMS_CD C WHERE C.XH = '200909271033495d64880c587a4beda5bbac86fd92e0ec' UNION ALL SELECT CSC.*FROM T_ADMIN_RMS_CD AS CSC INNER JOIN NODES AS RC ON CSC.FCDXH = RC.XH) SELECT FROM T_ADMIN_RMS_CD WHERE XH IN (SELECT XH FROM NODES N )