I have the following query which checks my tables for rows where the AccountNumber is not found in an array:
--Select the total number of domestic keypad customers who left in march
select New_FirstName,New_LastName,New_AccountNumber,New_KeyPadPremiseNo ,New_DateCustomerLeft, c.Line1,c.Line2,c.Line3,c.City,c.PostOfficeBox from AccountExtensionBase as a
inner join CustomerAddressBase as c on a.AccountId = c.ParentId
where New_DateCustomerLeft between '1 feb 2015' and '1 mar 2015'
and AddressTypeCode = 1
and New_AccountType = 5
and New_AccountNumber not in (123,456,789,101112,131415)
How can I check if my array contains a number that is not found in the database like:
select from ((123,456,789,101112,131415)
where not in (select from table)