当前位置: 代码迷 >> Oracle管理 >> 怎么用sql语句返回近一年中每月的数据统计
  详细解决方案

怎么用sql语句返回近一年中每月的数据统计

热度:75   发布时间:2016-04-24 06:02:13.0
如何用sql语句返回近一年中每月的数据统计?
比如,有个表中有个date字段,如何用sql返回近一年中每个月的数据量count(*),能用sql语句做到吗?谢谢大家帮忙..

------解决方案--------------------
select to_char(date1, 'yyyy/mm '),count(*) from table1
group by to_char(date1, 'yyyy/mm ')
------解决方案--------------------
近一年的就

select to_char(foccurdate, 'yyyy/mm ') d,count(*) c from wz_enterbill eb
where eb.foccurdate> =add_months(sysdate,-11)
group by to_char(foccurdate, 'yyyy/mm ')
  相关解决方案