GROUP BY 引用外部参数的问题
定义一个游标,@temp是外部参数
declare YB1 CURSOR FOR select count(tjs6600),tjs6605,convert(varchar(100),@temp,23) from tjs66 LEFT OUTER JOIN TRS14 ON TRS1400=TJS6605 left outer join tjs13 on tjs1300=tjs6602 where ( @temp<tjs6604 and tjs6613<dateadd(dd,1,@temp) and tjs6613 is not null ) or ( @temp<tjs6604 and tjs6613 is null and tjs1319='G' and tjs6614<>6 ) or ( tjs6604<@temp and tjs6613<dateadd(dd,1,@temp) and tjs6612 is not null) or ( tjs6604<@temp and tjs6613 is null and tjs1319='G' and tjs6614<>6 ) group by tjs6605,convert(varchar(100),@temp,23) ----问题在这