日期:2014-05-17 浏览次数:20532 次
declare @riqi int=2012 select convert(varchar(7),a.riqi,120),sum(b.[金额]) as total from table1 as a with(nolock) inner join table2 as b with(nolock) on a.id=b.id where datepart(a.riqi)=@riqi group by convert(varchar(7),a.riqi,120)