>> INSERT INTO tblCustInfo (account_Number, etc)
>> SELECT account_Number, etc
>> FROM tblEXCELL_IMPORT
>> WHERE account_Number NOT IN (
>> SELECT DISTINCT(account_Number)
>> FROM tblCustInfo )
>>
> I think the NOT IN is incorrect
hi terry
it's actually okay, assuming the database allows you to insert into the
same table you're querying (some don't like this type of self-reference)
in the above case the subselect is not correlated so i can't see it not
working ;o)
(how's that for a comeback to your "NOT IN is incorrect"?)
another way, that avoids this self-reference, is to delete the dupes from
the imported table first --
delete from tblEXCELL_IMPORT
where account_Number IN (
SELECT DISTINCT(account_Number)
FROM tblCustInfo )
insert into tblCustInfo (account_Number, etc)
select account_Number, etc
from tblEXCELL_IMPORT
rudy
http://rudy.ca/
-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "rudy" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)