string sql = "select Code,DepartmentName" + ",(select top 1 OrgName from SysBest_Organization where TreeId = CompanyId ) as CompanyId" + ",(select top 1 OrgName from SysBest_Organization where TreeId = ParentDepartmentId ) as ParentDepartmentId" + ",(select top 1 OrgName from SysBest_Organization where TreeId = AdjustedParentCompanyId ) as AdjustedParentCompanyId" + ",(select top 1 OrgName from SysBest_Organization where TreeId = AdjustedParentDepartmentId ) as AdjustedParentDepartmentId" + ", AdjustedCode,AdjustedDepartmentName,AdjustedDate,Regulator,VGUID from X6_Organization_DepartmentAdjust ";
转载于:https://www.cnblogs.com/tangpeng97/p/8004393.html