MSSQL父子关系表的SQL查询(SQL Query for Parent Child Relationship)
建立一个数据表NodescreatetableNodes(NodeIdint,NodeNamenvarchar(50),ParentIdint)写入数据insertintoNodes(NodeId,NodeName,ParentId)values(1,'Node1',0),(2,'Node2',0),(3,'Node3',1),(4,'Node4',1),(5,'Node5',3),(6,'Nod