I currently need to find all the differences between a new_master dataset and a previous one using SQL Oracle. The datasets have the same structure and consist of both integers and strings and do not have a unique key id unless I select several columns together. You can see an image at the beginning as image_table. I found online this code and I wanted to ask you if you have any advices.
SELECT n.*
FROM new_master as n
LEFT JOIN old_master as o
ON (n.postcode = o.postcode)
WHERE o.postcode IS NULL
SORT BY postcode
In doing so I should get back all the entries from the new_master that are not in the old one.
Thanks
If you are in an Oracle databse, there are a couple queries that can help you find any differences.
Find any records in OLD that are not in NEW.
Find any records in NEW that are not in OLD.
Count number of items in OLD
Count number of items in NEW
The
COUNT
queries are needed in addition to theMINUS
queries in case there are duplicate rows with the same column data.