I have a sql instruction to insert data into a table for archiving, but I need a monthly merge instruction to update the new table (2) with any data that was changed in the old table (1), which should now be transferred to archive.
Part of the problem is deleting the moved data from the old table. My insertion does not do this, but I need to have it where the stored data is deleted from the source table.
Is there one sql statement that moves data from one table to another this way? Or should it be a two-step operation?
the original operator moved data based on age and several other relative factors. insert:
INSERT INTO tab1 SELECT * FROM tab2 WHERE (Postingdate < TO_DATE ('2001/07/01', 'yyyy/mm/dd') OR jobname IS NULL) AND STATUS <> '45';
All help is appreciated ...
source share