I have built a Union query to comapre the data in two identicle tables.I have deliberately not done a UNION ALL so as to exclude duplicate records.
It appears to work OK and extracts 2 instances of each record that has changed the "before" and "after" and also includes "New" records.
However, it also appears to then include a single instance of records that have not changed from one of the tables. How can I prevent this?
my code is:-
Should I add a WHERE clause somewhere?
If IT ain’t working Binnit and Reboot
It appears to work OK and extracts 2 instances of each record that has changed the "before" and "after" and also includes "New" records.
However, it also appears to then include a single instance of records that have not changed from one of the tables. How can I prevent this?
my code is:-
Code:
SELECT FolioRef, FolioPolicyNo, FolioCoverFrom, FolioCoverTo, FolioRenewalDate, FolioCanxDate, FolioOccupation, FolioInsured, FolioAddress, FolioBuildingsDV, FolioBuildingsUplift, FolioContentsSI, FolioRentSI, FolioRentMIP, FolioPremium, FolioPostCode, FolioTerrorismPremium, FolioTerrorismEffDate
FROM tblPreDecFolioDetails
UNION SELECT FolioRef, FolioPolicyNo, FolioCoverFrom, FolioCoverTo, FolioRenewalDate, FolioCanxDate, FolioOccupation, FolioInsured, FolioAddress, FolioBuildingsDV, FolioBuildingsUplift, FolioContentsSI, FolioRentSI, FolioRentMIP, FolioPremium, FolioPostCode, FolioTerrorismPremium, FolioTerrorismEffDate
FROM tblFolioDetails;
Should I add a WHERE clause somewhere?
If IT ain’t working Binnit and Reboot