首页 > 数据库技术 > 详细

oracle查询某个时间点的数据

时间:2016-02-15 16:21:00      阅读:286      评论:0      收藏:0      [点我收藏+]

1. select * from emps as of timestamp to_Date(‘2015-12-11 14:00:00‘,‘yyyy-mm-dd hh24:mi:ss‘),SQL语句是查询某一时间点上的表中的所有数据,可用于恢复误删(全部误删)的数据

2.恢复误删数据(全部误删)

insert inot emps  select * from emps as of timestamp to_Date(‘2015-12-11 14:00:00‘,‘yyyy-mm-dd hh24:mi:ss‘)

3.恢复部分误删数据:

insert into emp   (select * from emps  as of timestamp to_Date(‘2015-12-11 14:00:00‘,‘yyyy-mm-dd hh24:mi:ss‘)  where emp_id not in (select emp_id from emps))

只插入误删的数据,将表中存在的数据过滤掉

oracle查询某个时间点的数据

原文:http://www.cnblogs.com/zijinyouyou/p/5190696.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!