SQL语句的优化问题
select a.ProjectGUID,a.ProjectName
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-01'),'×') 项目建议书
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-02'),'×') 工程可行性研究
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-03'),'×') 项目立项
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-04'),'×') 工程规划
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-05'),'×') 勘测红线
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-06'),'×') 地形图测量
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-07'),'×') 工程地质勘察
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-08'),'×') 环境评价
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-09'),'×') 地质灾害评估
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-10'),'×') 初步设计
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-11'),'×') 规划用地红线
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-12'),'×') 土地测绘
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-13'),'×') 土地呈报表
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-14'),'×') 建设管理招投标
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-15'),'×') 施工图设计及审查
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-16'),'×') 征地拆迁
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-17'),'×') 财务决算
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-18'),'×') 施工招投标
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-19'),'×') 监理招投标
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-20'),'×') 建设工程规划许可证
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-21'),'×') 建设工程施工许可证
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-22'),'×') 工程设计变更
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-23'),'×') 工程概算
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-24'),'×') 工程决算
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-25'),'×') 移交
,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-26'),'×') 竣工验收
--,isnull((select '√' guid from ProjectState where ProjectGUID=a.ProjectGUID and ProjectPhase=a.ProjectStates and StateCode='Build-26'),'×') 竣工验收
from ProjectInfo a
where
a.ProjectStates='test'
And a.ProjectAction=1
Order By a.ProjectType Asc, a.OrderIndex Asc
我这个SQL语句能不能再优化一下,这个SQL语句在查询时速度太慢了.