Help - Delete duplicate records comparing 2 tables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am in need of assistance. I have a table set up to receive a data feed on a daily basis. This table is called TBL_WORKING_WASP_FILE. I use this data to select a random sample of 100 and send surveys out. I then append the sample population to a table named TBL_MASTER_SAMPLE_FILE. I am running into problems because there may be duplicates between the TBL_WORKING_WASP_FILE and TLB_MASTER_SAMPLE_FILE. I do not want to send a survey out to someone who has already received one. Is there a way to cross check the data with the TBL_MASTER_SAMPLE_FILE to dedup. There is a unique customer id assigned to each person. Currently, my work around is to run a find duplicates query at the end, but because of some autoid issues with the sample data, this is proving to be cumbersome. Any suggestions would be helpful. Thanks!
 
Karen,

Instead of selecting your sample directly from table TBL_WORKING_WASP_FILE,
employ a simple select query on the table, and put the following in the
criteria line below field customer id (or whatever you call it):

Not In (SELECT Customer_ID FROM TBL_MASTER_SAMPLE_FILE)

where I have assumed the customer id field in table TBL_MASTER_SAMPLE_FILE
is called Customer_ID; change as required.

HTH,
Nikos

Karen M said:
I am in need of assistance. I have a table set up to receive a data feed
on a daily basis. This table is called TBL_WORKING_WASP_FILE. I use this
data to select a random sample of 100 and send surveys out. I then append
the sample population to a table named TBL_MASTER_SAMPLE_FILE. I am running
into problems because there may be duplicates between the
TBL_WORKING_WASP_FILE and TLB_MASTER_SAMPLE_FILE. I do not want to send a
survey out to someone who has already received one. Is there a way to cross
check the data with the TBL_MASTER_SAMPLE_FILE to dedup. There is a unique
customer id assigned to each person. Currently, my work around is to run a
find duplicates query at the end, but because of some autoid issues with the
sample data, this is proving to be cumbersome. Any suggestions would be
helpful. Thanks!
 
Back
Top