标签:sele ted pre gui parent uid ati ring string
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 ";
子查询一定要注意,别忘记加TOP 1,不然就GG了,过了好久测试给我测出来了
标签:sele ted pre gui parent uid ati ring string
原文地址:http://www.cnblogs.com/tangpeng97/p/8004393.html