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

推荐订阅源

Google DeepMind News
Google DeepMind News
D
Docker
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
月光博客
月光博客
小众软件
小众软件
量子位
V
Visual Studio Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
罗磊的独立博客
博客园 - 叶小钗
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
博客园 - 司徒正美
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
C
Check Point Blog

博客园 - Winner.Net(2007)

centos 端口开放及关闭 Can't connect to MySQL server on 'ip' (13) CentOS 6.0 系统 LAMP(Apache+MySQL+PHP)安装步骤 linux 开启 mount PHP与MYSQL事务处理 型B2C电子商务网站组织架构分析 转 PHP _construct _destory _call _get _set等 - Winner.Net(2007) eew CSS+js 实现mouse移动单元格上全部显示 web2.0网站的性能优化方法 (转) Web应用性能优化黄金法则——转 js编码处理(转) 服务器推技术 网页标签解析 转http状态码 登陆抓取数据 - Winner.Net(2007) - 博客园 观察者+js 模式 - Winner.Net(2007) - 博客园 JS倒计时 - Winner.Net(2007) - 博客园 EXT 列头合并的例子 - Winner.Net(2007) - 博客园
sql得到时间
Winner.Net(2007) · 2009-02-24 · via 博客园 - Winner.Net(2007)

sql得到当前系统时间得

       日期部分 CONVERT(varchar(10),getDate(),120)

       昨天 select convert(varchar(10),getdate() - 1,120)

明天 select convert(varchar(10),getdate() + 1,120)

最近七天 select * from tb where 时间字段 >= convert(varchar(10),getdate() - 7,120)

随后七天 select * from tb where 时间字段 <= convert(varchar(10),getdate() + 7,120) and 时间字段 >= 时间字段

如果是在表中查詢

--昨天  Select * From TableName Where DateDiff(dd, DateTimCol, GetDate()) = 1

--明天 Select * From TableName Where DateDiff(dd, GetDate(), DateTimCol) = 1

--最近七天 Select * From TableName Where DateDiff(dd, DateTimCol, GetDate()) <= 7

--随后七天 Select * From TableName Where DateDiff(dd, GetDate(), DateTimCol) <= 7

--上周 Select * From TableName Where DateDiff(wk, DateTimCol, GetDate()) = 1

--本周 Select * From TableName Where DateDiff(wk, DateTimCol, GetDate()) = 0

--下周 Select * From TableName Where DateDiff(wk, GetDate(), DateTimCol ) = 1

--上月 Select * From TableName Where DateDiff(mm, DateTimCol, GetDate()) = 1

--本月 Select * From TableName Where DateDiff(mm, DateTimCol, GetDate()) = 0

--下月 Select * From TableName Where DateDiff(mm, GetDate(), DateTimCol ) = 1

另我写的一个

select top 1 a.topicid,a.title,a.boardid,a.postusername,a.lastpost,a.lastposttime,a.dateandtime,b.boardtype from dv_topic a,dv_board b where a.boardid<>444 and b.boardid=a.boardid AND (a.istop = 1 OR a.isbest = 1) and (DateAndTime BETWEEN (SELECT CONVERT(varchar(10), GETDATE() - 30, 120)) AND (SELECT CONVERT(varchar(10), GETDATE(), 120))) order by Hits desc 一个月内论坛里加为精华或置顶的帖子