from 테이블명
as of timestamp(systimestamp - interval '숫자' minute);
create table 테이블명_backup
as
select *
from 테이블명 as of timestamp(systimestamp - interval '숫자' minute);
-- systimestamp : yy/mm/dd hh24:mi:ss.ms 현재시각
-- 현재시각에서 interval 숫자 minute 전 을 timestamp에 저장
-- create 전에 select 문 만 실행해보고
-- 원하는 결과가 나오면 바로 create 하기!! => 시간이 계속 흐르기 때문!!
select *
from 테이블명 as of timestamp(systimestamp - interval '숫자' minute)
MINUS
select *
from 테이블명;
-- 다른부분만 골라내어 테이블 만들기 [2-1]
create table 테이블명_origin
as
select *
from 테이블명 as of timestamp(systimestamp - interval '숫자' minute)
MINUS
select *
from 테이블명;
-- 테이블 병합하기
merge into 테이블명 A
using 테이블명_origin B
on (A.no = B.no)
when matched then -- 똑같은 것이 있을 경우
update set E.name = O.name
, E.address = O.address
when not matched then -- 똑같은 것이 없을 경우
insert (no, name, address) values(O.no, O.name, O.address);
-- no, name, address 는 컬럼명이다.
-> local_hr에서작업한것