none
fetchxml 中可以用子查询吗? RRS feed

  • 问题

  • SELECT [fullname]
          ,[skills]
          ,[systemuserid]
          ,(SELECT count(t.new_workordernum)FROM
            [_0ITSM_MSCRM].[dbo].[FilteredTask] as t
            where u.systemuserid=t.new_seviceengineer and t.new_orderstate=1 and Month(t.new_completedate)=Month(GETDATE()) and DATEPART(YEAR,t.new_completedate)= DATEPART(YEAR,GETDATE()) )
            as '未关闭'
            ,(SELECT count(t.new_workordernum)FROM
            [_0ITSM_MSCRM].[dbo].[FilteredTask] as t
            where u.systemuserid=t.new_seviceengineer and t.new_orderstate=0) 
            as '本月已关闭'
          FROM [_0ITSM_MSCRM].[dbo].[FilteredSystemUser] as u

     

    上面一段怎么翻译成fetchxml?

    2011年8月10日 6:30

全部回复