SQL查询当天数据
2015-10-28 15:51
134 查看
--查询当天:
select * from info where DateDiff(dd,datetime,getdate())=0
--查询24小时内的:
select * from info where DateDiff(hh,datetime,getDate())<=24
--info为表名,datetime为数据库中的字段值
--查询当天:
select * from info where DateDiff(dd,datetime,getdate())=0
--查询24小时内的:
select * from info where DateDiff(hh,datetime,getDate())<=24
--info为表名,datetime为数据库中的字段值
select * from info where DateDiff(dd,datetime,getdate())=0
--查询24小时内的:
select * from info where DateDiff(hh,datetime,getDate())<=24
--info为表名,datetime为数据库中的字段值
--查询当天:
select * from info where DateDiff(dd,datetime,getdate())=0
--查询24小时内的:
select * from info where DateDiff(hh,datetime,getDate())<=24
--info为表名,datetime为数据库中的字段值
相关文章推荐
- WordPress数据库及各表结构
- sql语句中charindex函数用法
- 在postgresql中使用limit实现select top x
- centos 6.5 安装php redis 扩展
- oracle数据库两表数据比较
- MySQL在Ubuntu系统的三种自启动方法
- postgresql 忘记 postgres 密码
- 王团结:七牛是如何搞定每天500亿条日志的
- MySQL 5.6 & 5.7最优配置文件模板
- Win7上安装32位Oracle客户端错误解决方法:[INS-30131] 执行安装程序验证所需的初始设置失败
- 向mysql数据库中写入中文,报错问题解决
- 为数据库表和列取好名字(转)
- window下memcached安装步骤及使用
- 将 oracle.sql.BLOB转为byte[] 输出(java)
- MySQL下concat函数中null值问题
- 安装ORACLE RAC时修改ssh端口导致CRS无法安装
- Oracle数据泵IMPDP导入
- MySQL的MyISAM与INNODB对比
- 重新思考关系型数据库的设计
- MySQL安装设置详细教程