我觉得你可以将数据取出来之后,在代码中实现统计。
使用 正则表达式。不知道你的代码是什么语言。
你查询出数据之后 可以用正则表达式 匹配每个月的数据 然后对这些数据进行
统计就行了
select count(*),to_char(betime,'YYYY-MM') AS BETIME from tableA
group by to_char(betime,'YYYY-MM')
我练习一下
select count(*),to_char(betime,'YYYY-MM') AS BETIME from tableA
group by to_char(betime,'YYYY-MM')
select datepart(year,BeTime)*100+datepart(month,TeTime) NY,count(*) SL from tableA
group by datepart(year,BeTime)*100+datepart(month,TeTime)
select datepart(year,BeTime)*100+datepart(month,TeTime) NY,count(*) SL from tableA
group by datepart(year,BeTime)*100+datepart(month,TeTime)