//查詢某年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');