I have a table t_review that stores historical records including key sid and timestamp dt. Every day, more records come into table t_new. I use the following scripts to add those new records identified by sid in t_new to t_review.
begin
insert into t_review(sid, dt) select sid, sysdate from
(select sid from t_new minus select sid from t_review);
commit;
end;
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.