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

推荐订阅源

S
Schneier on Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
Threat Research - Cisco Blogs
C
Cyber Attacks, Cyber Crime and Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
A
Arctic Wolf
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
I
Intezer
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Troy Hunt's Blog
Latest news
Latest news
Help Net Security
Help Net Security
S
Security Affairs
Webroot Blog
Webroot Blog
The Hacker News
The Hacker News
AI
AI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Tor Project blog
Forbes - Security
Forbes - Security
Google DeepMind News
Google DeepMind News
AWS News Blog
AWS News Blog
Attack and Defense Labs
Attack and Defense Labs
P
Proofpoint News Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Help Net Security
L
Lohrmann on Cybersecurity
S
SegmentFault 最新的问题
Google Online Security Blog
Google Online Security Blog
MongoDB | Blog
MongoDB | Blog
Cyberwarzone
Cyberwarzone
The Last Watchdog
The Last Watchdog
S
Securelist
N
News and Events Feed by Topic
S
Secure Thoughts
F
Fortinet All Blogs
博客园_首页
C
Cybersecurity and Infrastructure Security Agency CISA
量子位
M
MIT News - Artificial intelligence
F
Full Disclosure
T
The Blog of Author Tim Ferriss
T
Tailwind CSS Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
P
Privacy International News Feed
L
LangChain Blog
Know Your Adversary
Know Your Adversary
C
CERT Recently Published Vulnerability Notes

博客园 - lrary

JavaScript经典技巧 - lrary - 博客园 动态添加ASP.NET控件并绑定处理事件一例 - lrary - 博客园 脚本收藏 - lrary - 博客园 特殊的DataGrid的绑定 - lrary - 博客园 纯脚本搞掂DataGrid表表头不动,表身滚动。(转摘) - lrary - 博客园 检验密码强度的JS类 - lrary - 博客园 数据库设计规范 V2.0 SQL语句特---殊统计(1) DataGrid 多行 DataGrid怎么产生一个分类的题头 AJAX 在.net的应用 sql怎么使用外连接 Asp.NET程序中常用的三十三种代码 检测含有中文字符串的实际长度 根据区位得到汉字拼音首字母(c#) 认识ASP.NET配置文件Web.config Asp.net(C#)实现验证码功能 给Repeater、Datalist和Datagrid增加自动编号列 查找和统计页面上控件
一些sql语句的详细解释[转]
lrary · 2006-05-31 · via 博客园 - lrary

/*
*注释添加:
∮明天去要饭
*/SELECT

/*
* 输出格式: x年x周
* 如:200621
*/

Convert(varchar(4),intYear) +           /* 先将intYear列转成字符型 */
case when len(intWeek)=1               /* 判断intWeek列的长度是否为1 */
 then
  '0' + Convert(varchar(1),intWeek)   /* intWeek列为1位数字时转化成两位字符,最前面补0 */
  else
  Convert(varchar(2),intWeek)           /* 如果是两位则直接转成字符 */
end
as allYearWeek,                                  /* 给列取别名allYearWeek */

/*
* 输出格式: xxxx年xx周
* 如:2006年21周
*/

Convert(varchar(4),intYear) + '年' +
case when len(intWeek)=1
 then
  '0'+ Convert(varchar(1),intWeek)
 else
  Convert(varchar(2),intWeek)
end
 + '周' as DesYearWeek ,

/*
* 输出格式:x月x日~x月x日
* 如: 05.22~05.28
 */

right(replace(strWeekBeginDate,'-','.'),5) +   /* 先把替换为".",然后再取右边5位 */
'~' +
right(replace(strWeekEndDate,'-','.'),5)
as DesDate

FROM V_GetAllWeeks order by intYear Desc, intWeek Desc

输出结果:

allYearWeek      DesYearWeek               DesDate
200621                2006年21周                  05.22~05.28
200620                2006年20周                  05.15~05.21
200619                2006年19周                  05.08~05.14
200618                2006年18周                  05.01~05.07
200617                2006年17周                  04.24~04.30
200616                2006年16周                  04.17~04.23
200615                2006年15周                  04.10~04.16
200614                2006年14周                  04.03~04.09
200613                2006年13周                  03.27~04.02
200612                2006年12周                  03.20~03.26