//查询某年1-12月的数据

select to_char(createdate,'yyyy-mm') 月份,count(*) 数量 from cms_news where ispub='1' 

and createdate between to_date('2014-01','yyyy-mm') and to_date('2014-12','yyyy-mm') group by to_char(createdate,'yyyy-mm') order by to_char(createdate,'yyyy-mm');

 

//查询每年每月的数据

select to_char(createdate,'yyyy-mm') 月份,count(*) 数量 from cms_news group by to_char(createdate,'yyyy-mm') order by to_char(createdate,'yyyy-mm');

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-02
猜你喜欢
  • 2021-09-18
  • 2021-05-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-02
相关资源
相似解决方案