-->测试数据1: @Test
declare @Test table (ProName varchar(6),Price smallint,Date datetime)
insert into @Test
select '产品一',200,'2007-1-1' union all
select '产品一',240,'2007-1-3' union all
select '产品一',280,'2007-1-8' union all
select '产品一',230,'2007-2-2' union all
select '产品一',260,'2007-2-9'select ProName,Price=avg(Price),Date=convert(varchar(7),Date,120) from @Test group by ProName,convert(varchar(7),Date,120)/*
ProName Price       Date    
------- ----------- ------- 
产品一     240         2007-01
产品一     245         2007-02
*/