sql 查询一段时间内 每一天的统计数据

2025-03-25 01:53:18
推荐回答(2个)
回答1:

select xx.time as "时间",count(id) as "条数" from record xx where xx.time between '2014-09-01' and '2014-10-01' group by xx.time;

回答2:

select 时间,count(时间) as 条数 from record where 时间  between '2014-09-01' and '2014-10-01' group by 时间
或者
select 时间,count(时间) as 条数  from (
select convert(varchar(10),时间,120) as 时间  from record where 时间  between '2014-09-01' and '2014-10-01' ) as t group by 时间