菜鸟求助:如何查询近三分钟的记录

lori_wu 2005-02-20 09:48:56
小弟为此在表LogEvent中添加了LogTime字段(日期时间型),使用的是sqlserver2000,假设
当前时间是"2005-2-20 20:37:32" 现欲查询近三分钟该表记录,烦请各位大虾写出sql查询
语句.
select * from LogEvent where LogTime.......help....
...全文
51 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
xhxhxhxh 2005-02-20
  • 打赏
  • 举报
回复
用函数datediff(mi,LogTime,getdate())
didoleo 2005-02-20
  • 打赏
  • 举报
回复
select * from LogEvent where
datediff(mi,LogTime,getdate()) between 1 and 3

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧