一条关于年份和月份提取的使用于统计图的SQL语句:
select RTRIM(LTRIM(str(year(finddate)))) +'年' as r ,RTRIM(LTRIM(str(month(finddate))))+'月' as c , count(*) as y from ccii_ht group by RTRIM(LTRIM(str(year(finddate)))) +'年' ,RTRIM(LTRIM(str(month(finddate))))+'月' order by RTRIM(LTRIM(str(month(finddate))))+'月'
月份是大类
简单同一功能SQL语句:
select year(finddate) as r ,month(finddate) as c , count(*) as y from ccii_ht group by year(finddate) ,month(finddate) order by month(finddate)
阅读(1122) | 评论(0) | 转发(0) |