cf-talk  

Troubles with duplicates in select, only need one row per email address.

Casey Dougall
Wed, 17 Mar 2010 11:30:07 -0700

Hi,

This always drives me nuts and I can never figure it out or where on earth
I'm doing something simular.



 LeadID Email  1 ca...@domain.com  2 ca...@domain.com  3 ca...@domain.com  4
ca...@domain.com

I just want 1 LeadID and 1 Email out of the 4 records.

Why can't you group by 1 column when really want to select 2 or more at the
same time. :-(

   SELECT distinct (Email), LeadID
   FROM Leads
   group by Email

I just wish that would work. Mind you there a bunch of additional columns so
it's more like needing

SELECT distinct (Email), LeadID, FirstName, LastName
FROM Leads


Dam I hate this scenario.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331817
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm