`
piperzero
  • 浏览: 3472740 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

oracle 查询N秒之前的数据

 
阅读更多

select* from txt001_menu

as of timestamp (systimestamp - interval '300'minute)

wheremenuid = '060201' --查找txt001_menu表中300分钟之前的数据

>>>>select * from txt001_menu as of timestamp (systimestamp - interval'600' second) where menuid = '060201' --查找txt001_menu表中600秒之前的数据

>>>>select * from txt001_menu as of timestamp (systimestamp - interval '3'hour)

wheremenuid = '060201' --查找txt001_menu表中3小时之前的数据

>>>>select * from txt001_menu as of timestamp (systimestamp - interval '1'day)

wheremenuid = '060201' --查找txt001_menu表中1天之前的数据

——————————————————————————————————————————————

timestamp(ags) 方法

interval(时间间隔)类型用来存储两个时间戳之间的时间间隔

时间间隔类型interval请看下一篇文章:http://blog.sina.com.cn/s/blog_4b5bc01101011d76.html

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics