子查詢一定要註意,別忘記加TOP 1,不然就GG了,過了好久測試給我測出來了
阿新 • • 發佈:2017-12-08
date 子查詢 註意 string tde best ani rtm 測試
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了,過了好久測試給我測出來了