Я пытаюсь использовать подзапросы, чтобы выполнить сопоставление с несколькими таблицами и переместить несопоставленные записи в новую таблицу.
Я написал подзапросы SQL, но единственная проблема, с которой я сталкиваюсь, - это производительность, она требует многовремени на обработку.
create table UnmatchedRecord
(select a.*
from HashedValues a
where a.Address_Hash not in(select b.Address_Hash
from HashAddress b)
and a.Person_Hash not in(select d.Person_Hash
from HashPerson d)
and a.HH_Hash not in(select f.HH_Hash
from HashHH f)
and a.VehicleRegistration not in(select VehicleRegistration
from MasterReference)
and a.EmailAddress not in (select EmailAddress
from MasterReference)
and a.PhoneNumber not in (select PhoneNumber
from MasterReference)
and a.NationalInsuranceNo not in (select NationalInsuranceNo
from MasterReference))