首页 > 数据库技术 > 详细

SQL比较时间查询语句

时间:2017-07-03 12:56:42      阅读:177      评论:0      收藏:0      [点我收藏+]

 

select * from table1 
where datediff(mm,‘2009-8-12 13:17:50‘, date)>0

  

select * from table1 
where datediff(ms,2009-8-12 13:17:50, date)>0

 

select * from table1 where cast(date as datetime)>2009-8-12 13:17:50

 

select * from table1 where CONVERT(DATETIME,date)>2009-8-12 13:17:50 

 

本人测试这条也能通过:

select * from RoomInfo where CreateTime > 2017/7/3 10:46:33;

 

SQL比较时间查询语句

原文:http://www.cnblogs.com/Raywang80s/p/7110455.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!