> The records are from contest entries. People can only enter with one email 
> address. Some people entered multiple times, using the same email address. 

So, why all the complexity with joins and subqueries?  Just...

SELECT DISTINCT email FROM sometable

....then pick a winner from the list of unique e-mail addresses.  Go back 
and grab one of the entries with that e-mail address at random for the 
contact information.  This way you're picking from a list of unique 
e-mail addresses that entered the drawing.

It also begs the question, if they were only supposed to have one entry 
per e-mail address, why wasn't there error checking or a constraint on 
the table to force this in the first place?


-Justin Scott, http://www.tlson.com/



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:312618
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to