Reputation: 98
Let us say there is table A. Table B replicates table A by using an upsert statement on a file that has only the updated records found on table A. It is easy to tell whether table A records where updated, as it will reflect on the column that shows the last modified date for said records. However, table A does not show any signs whether any records that were deleted (there is not a flag column that shows whether the record is deleted or not due to the huge amount of active records the table contains). If a record is deleted, said record will not show up anymore when trying to fetch it.
So given the above context, after I do my upsert on table B, I found so far that to mirror removed records from original table, I have to download a file of the full list of primary key columns currently available in table A for creating table C and use that to do an inner join with the primary keys on table B.
My question is: Is there a better way to do this where I don't have to download a file of the full list of primary key columns currently available in table A?
Upvotes: 0
Views: 44