I'm writing an  emailing application and we're going to be selecting our
addresses from 3 different subscriber  tables, based on a whole bunch of
criteria.    I want to merge the 3 queries from the tables into one, then
de-dup so we only send one email to each subscriber.

Is the following  the best process to do this?

[A] Select the addresses from each table, based on criteria related to that
table into Qsubscribers, Qmembers, QSeminarAttendees

[B] Create a new query (QTempQuery)  in memory, and loop through each of the
first queries, inserting the records into the new query.

[C] De-dup QTempQuery  by using QueryofaQuery to select DISTINCT from
QTempQuery.   

Is there a better way to do it?  Seems like a lot of stuff going on in
memory without anything being written off to disk at all.  At the moment
there will be about 2500 records I guess but if it gets too big I might run
out of memory mightn't I?

And what's the SQL to use emailaddress as the key for SELECT DISTINCT, but
still to select all the other fields in the query?  (the query has fields
called  emailaddress, firstname, lastname, emailsentYN)



Cheers

Mike Kear

AFP Webworks

Windsor, NSW, Australia

http://afpwebworks.com
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to