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

推荐订阅源

Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
The Register - Security
The Register - Security
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
P
Proofpoint News Feed
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
The Last Watchdog
The Last Watchdog
F
Fortinet All Blogs
S
Schneier on Security
Help Net Security
Help Net Security
Security Archives - TechRepublic
Security Archives - TechRepublic
C
Check Point Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
I
InfoQ
T
The Blog of Author Tim Ferriss
Cisco Talos Blog
Cisco Talos Blog
Stack Overflow Blog
Stack Overflow Blog
T
Troy Hunt's Blog
人人都是产品经理
人人都是产品经理
T
Threatpost
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cyber Attacks, Cyber Crime and Cyber Security
雷峰网
雷峰网
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
Forbes - Security
Forbes - Security
Vercel News
Vercel News
S
Security Affairs
美团技术团队
P
Privacy & Cybersecurity Law Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Jina AI
Jina AI
Spread Privacy
Spread Privacy
Attack and Defense Labs
Attack and Defense Labs
IT之家
IT之家
U
Unit 42
Recorded Future
Recorded Future
W
WeLiveSecurity
PCI Perspectives
PCI Perspectives
P
Palo Alto Networks Blog
H
Hacker News: Front Page
S
Security @ Cisco Blogs
博客园 - 【当耐特】

博客园 - Grok.Yao

sqlserver临时启用和关闭约束 string.format 参考 大O表示法 C# 日期格式化参考 查看sql语句的执行时间及缓存执行计划 查看索引执行次数 (转)JQuery有用的50段代码 查询指定日期区间内的每一天 FF和IE兼容的捕获回车事件问题 回车自动提交Form表单的问题 将数据库记录倒为Insert语句的存储过程 IE下 JS添加Select元素的option问题 VS中的常用快捷键,可以提高开发效率 ashx中使用Session问题 关于CSS控制TD换行与否的问题解决 TFS2008 无法撤销锁定的签出 C#中集合查询的问题! 本地SQL脚本操作外部服务器结果集 RSA容器权限问题
Sql获取随机时间
Grok.Yao · 2011-02-15 · via 博客园 - Grok.Yao

Sql里获取随机的日期时间。

        --设置起始日期
        declare @starttime datetime
        --设置结束日志
        declare @endtime datetime
        set @starttime='2010-01-01'
        set @endtime = '2010-02-01'
        declare @ctime  datetime
        declare @count int
        --得到该日期段内随机的某一天日期
        select  @ctime= dateadd(SECOND,convert(int,(rand()*datediff(SECOND,@starttime,@endtime))),@starttime)
        print @ctime

深刻接受2楼朋友的意见,将sp改为普通sql了, 并加了些注释,方便大家参考。