标签:style blog http ar 2014 div sp 问题 log
做报表时遇到一个问题,根据日期字段查询一年中每月某项的统计数量,搞了有点时间才弄出来,贴出来分享一下。
1,oracle中以月分组的语句
<span style="font-size:18px;"> SELECT TO_NUMBER(TO_CHAR (T.BIRTH_DATE, 'mm'))getmonth, COUNT (T.UUID)TOTAL FROM T_PERSON T GROUP BY TO_CHAR (T.BIRTH_DATE, 'mm') ORDER BY getmonth</span>查询结果如下:
select month(CreateTime) newmonth,count(uuid) total from t_user group by month(CreateTime)
标签:style blog http ar 2014 div sp 问题 log
原文地址:http://blog.csdn.net/lishuangzhe7047/article/details/39344985