zoukankan      html  css  js  c++  java
  • 子查询一定要注意,别忘记加TOP 1,不然就GG了,过了好久测试给我测出来了

                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 ";
  • 相关阅读:
    164-268. 丢失的数字
    163-20. 有效的括号
    Sword 30
    Sword 29
    Sword 27
    Sword 25
    Sword 24
    Sword 22
    Sword 21
    Sword 18
  • 原文地址:https://www.cnblogs.com/tangpeng97/p/8004393.html
Copyright © 2011-2022 走看看