您的位置:首页 > 数据库 > Oracle

oracle 查询一段时间之前的数据

2013-08-09 14:22 232 查看
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请看我的另一篇博文:
Oracle INTERVAL DAY TO SECOND数据类型
本文出自 “IT精英的集中区” 博客,请务必保留此出处http://msuccess.blog.51cto.com/5486886/1268603
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: