根据日期分组显示语句怎么写的?
2007-01-22 14:41:06.670
2007-01-22 14:41:51.560
2007-01-22 15:15:07.123
2007-01-22 15:24:40.077
2007-01-19 18:20:34.000
2007-01-26 14:21:05.000
2007-01-26 14:28:14.000
2007-01-26 14:37:01.000
2007-01-26 18:04:05.000
2007-01-27 11:27:38.000
在表tbl_xin中其中有一列为日期型的,想以这列的日期分组显示,怎么写?
------解决方案--------------------Select tbl_xin=convert(varchar(10),tbl_xin,120),col2=sum(col2)
From testtable
group by convert(varchar(10),tbl_xin,120)
------解决方案--------------------select * form (select datepart(yyyy,日期) t1,datepart(mm,日期) t2,datepart(dd,日期) t3,* from 表) a group by t1,t2,t3
------解决方案--------------------select 日期列 from tbl_xin group by convert(char(10),日期列,21)