明天的明天 永远的永远 未知的一切 我与你一起承担 ??

是非成败转头空 青山依旧在 几度夕阳红 。。。
  博客园  :: 首页  :: 管理

比较时间的sql语句

Posted on 2007-07-20 11:15  且行且思  阅读(606)  评论(0编辑  收藏  举报
select * from 表名 where ABS(datediff(mi,时间字段名,getdate()))=60
----如果现在时间比库里时间大60秒用
select * from 表名 where datediff(mi,时间字段名,getdate())=60
----如果现在时间比库里时间小60秒用
select * from 表名 where datediff(mi,时间字段名,getdate())=-60