SQL比较时间查询语句

xiaoxiao2021-02-28  135

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';

 

转载请注明原文地址: https://www.6miu.com/read-26949.html

最新回复(0)