?
select * from( select Id=1, count(1)as 待審核 from T_TaskManage where CompleteState = '待審核' )A left join( select Id=1, count(1)as 未完成 from T_TaskManage where CompleteState = '未完成' )B on A.Id = B.Id left join( select Id=1, count(1)as 已完成 from T_TaskManage where CompleteState = '已完成' )C on A.Id = C.Id left join( select Id=1, count(1)as 延期完成 from T_TaskManage where CompleteState = '延期完成' )D on A.Id = D.Id
?
本文摘自 :https://www.cnblogs.com/