3sql语句错误,请检查! sql: select agg.productid,agg.groupid,aagc.Category,a.tzbh,a.tzmc,a.outDate from AAE_GroupCategory aagc left join tuanhao_dj td on td.category=aagc.id left join (select convert(datetime,t.ctsj) as outDate ,t.id,t.tzbh,t.tzmc,categoryId=case when (select top 1 categoryId from tuanhao_area where groupId=t.id)='1' then '1' when (select top 1 categoryId from tuanhao_area where groupId=t.id)='2' then '2' else '4' end from tuanhao_dj as t where isDate(t.ctsj) =1 and t.id in (select groupId from AAE_GP_GroupProduct) and t.ctzt<>'已经取消' and t.ctzt<>'实际完成' and t.ctsj like'%-%-%') as a on a.id=td.id left join AAE_GP_GroupProduct agg on a.id=agg.groupid where a.outdate>=getdate() and aagc.id=2 order by categoryId,a.id desc, outDate