I would like to insert some data collected from a query into a table which I have created to hold up only this specific data.
This is the initial statement (database is oracle):
insert into table b
(select a.id, a.changed, a.column_name, a.identification, a.old_text, a.new_text, d.id, d.no, d.name, d.status, d.status_date
from table_a a
inner table_d d
on d.id = a.id_double1
where table_name = 'DEVICE' and column_name = 'STATUS' or column_name = 'STATUS_DATE')
This statements works(I created table b with the same columns and data types as the columns in the select). What I want to do now is to run a nightly job, which only fetches the new records into the table and "skips" the already existing records.
Can somebody explain how to do this? Thank you very much!