先贴上我优化后的核心代码: select * into #result from ( select p.AchivementCount,isnull(a.ByAttentionCount,0) ByAttentionCount, u.Id,u.FullName,j.Name PostionName,u.ProfessionId,u.Disabled,u.UserName,u.ResearchArea,u.PositionId,u.DepartmentId,u.ORCID,d.Department…