您的位置:首页 > 数据库

SQL比较时间查询语句

2017-07-03 11:57 302 查看
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';
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: