惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Spread Privacy
Spread Privacy
H
Hacker News: Front Page
PCI Perspectives
PCI Perspectives
Webroot Blog
Webroot Blog
罗磊的独立博客
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
Last Week in AI
Last Week in AI
美团技术团队
Help Net Security
Help Net Security
The Hacker News
The Hacker News
C
Cisco Blogs
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
The Register - Security
The Register - Security
IT之家
IT之家
WordPress大学
WordPress大学
Jina AI
Jina AI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Help Net Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
NISL@THU
NISL@THU
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
B
Blog
T
Tenable Blog
博客园 - 三生石上(FineUI控件)
T
The Exploit Database - CXSecurity.com
S
Security Affairs
小众软件
小众软件
Hacker News: Ask HN
Hacker News: Ask HN
Security Latest
Security Latest
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
W
WeLiveSecurity
A
Arctic Wolf
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence

博客园 - Theo

【整理收藏】合并、压缩JS、CSS文件减少页面HTTP请求数的方法 前端要给力之:URL应该有多长? CSS Border使用小分享(转) 发个编程笑话,娱乐一下 sqlserver 生成100万个不重复的10位随机数存入数据库 SQL 分析函数over partition 分组数据后取前N条 增加排名列SQL语句(需排名的列值相等时排名相同) GridView样式设置 - Theo - 博客园 笔记下UltraEdit的一些常用使用技巧 Web 网页安全色谱 Asp.Net 操作XML基类 警惕采用编码过的SQL恶意注入 .net Repeater无数据时显示"no result" 快速解决方法 生成随机验证码图片程序 javscript 实现iframe加载内容页出现LOADING效果 javascript+ajax控制滑块实现滑杆拉动式评论翻页效果 Gridview 实现 全选多选(支持firefox) C# 实现实时3秒跳转页 - Theo - 博客园 遍历页面上所有TextBox控件并给它的Enabled赋值为false
各种按日期、时间段统计SQL语句
Theo · 2010-06-08 · via 博客园 - Theo

--前一日
select * from 表名 where  datediff(d,cast(日期  as  datetime),getdate())=1

--上周

select * from 表名 where  datediff(ww,cast(日期  as  datetime),getdate())=1

--上周

select * from 表名 where DATEPART(ww, 日期) = DATEPART(ww, GETDATE())-1 and DATEPART(yy, 日期) = DATEPART(yy, GETDATE())

--上月

select * from 表名 where  datediff(month,cast(日期  as  datetime),getdate())=1

--上年

select * from 表名 where  datediff(year,cast(日期  as  datetime),getdate())=1

--按日统计

select count(*),day([date]) from 表名 where year([date]) = '2006' group by day([date])

--按周

select count(*),datename(week,[date]) from 表名 where year([date]) = '2006' group by datename(week,[date])

--按月

select count(*),month([date]) from 表名 where year([date]) = '2006' group by month([date])

--按季

select count(*),datename(quarter,[date]) from 表名 where year([date]) = '2006' group by datename(quarter,[date])

--按年

select count(*),year([date]) from 表名 where
year([date]) >= '2000' group by year([date])