MSSQL查询统计
来源:互联网 发布:网络十大神曲污曲 编辑:程序博客网 时间:2024/05/22 03:28
select day(CreatedAt) 日 ,COUNT(Name) count from [Ruiec_NewCloud_BlogCenter].[dbo].[T_Blog_Demand]
where CreatedAt between '2017-06-01' and '2017-07-01'
group by year(CreatedAt),month(CreatedAt) ,day(CreatedAt) /*日统计*/
select month(CreatedAt) 月 ,COUNT(Name) count from [Ruiec_NewCloud_BlogCenter].[dbo].[T_Blog_Demand]
where CreatedAt between '2017-01-01' and '2017-12-31'
group by month(CreatedAt) ,year(CreatedAt) /*月统计*/
select sum(Name) as count,datepart(week,CreatedAt) 周 from
[Ruiec_NewCloud_BlogCenter].[dbo].[T_Blog_Demand] where CreatedAt between '2017-06-01' and '2017-07-01'
group by datepart(week,CreatedAt) /*周统计*/
select month(CreatedAt) 月 ,day(CreatedAt),COUNT(Name) count from [Ruiec_NewCloud_BlogCenter].[dbo].[T_Blog_Demand]
where CreatedAt between '2017-06-01' and '2017-07-01'
group by month(CreatedAt) ,day(CreatedAt)
where CreatedAt between '2017-06-01' and '2017-07-01'
group by year(CreatedAt),month(CreatedAt) ,day(CreatedAt) /*日统计*/
select month(CreatedAt) 月 ,COUNT(Name) count from [Ruiec_NewCloud_BlogCenter].[dbo].[T_Blog_Demand]
where CreatedAt between '2017-01-01' and '2017-12-31'
group by month(CreatedAt) ,year(CreatedAt) /*月统计*/
select sum(Name) as count,datepart(week,CreatedAt) 周 from
[Ruiec_NewCloud_BlogCenter].[dbo].[T_Blog_Demand] where CreatedAt between '2017-06-01' and '2017-07-01'
group by datepart(week,CreatedAt) /*周统计*/
select month(CreatedAt) 月 ,day(CreatedAt),COUNT(Name) count from [Ruiec_NewCloud_BlogCenter].[dbo].[T_Blog_Demand]
where CreatedAt between '2017-06-01' and '2017-07-01'
group by month(CreatedAt) ,day(CreatedAt)
阅读全文
0 0
- MSSQL查询统计
- MSSQL查询语句精华
- MSSQL查询题解
- MSSQL查询题解
- MSSQL 跨库查询
- MSSQL查询优化
- MSSQL分布式查询
- MSSQl分布式查询
- MSSQL查询方式(1)
- MSSQL分布式查询
- MSSQL DMV查询
- MSSQL动态查询
- MSSQl分布式查询
- MSSQL查询表结构
- MSSQL版本查询
- MSSQL执行分页查询
- MSSQL EXISTS子查询
- mssql查询表&记录
- HTML5 与 HTML4 的区别(3)
- 开启程序员的学习记录之旅
- jQuery动画的显示和隐藏
- SpringCloud Config-----4、动态刷新配置
- nginx配置limit_req限制ip访问速率详解
- MSSQL查询统计
- 第49天-Linux操作系统原理1
- 算法 第四版 2.1.12
- xftp中文乱码
- Deep learning: Technical introduction
- SpringCloud Config-----2、配置中心集群
- Linux红外线库-LIRC的配置FAQ
- HIT校园网ps4联机教程
- MySQL数据库中的悲观锁和乐观锁