|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Troubles with duplicates in select, only need one row per email address
Hi,Casey Dougall 03/17/10 02:11 P > I just want 1 LeadID and 1 Email out of the 4 records.John M Bliss 03/17/10 02:36 P 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 casey@domain.com 2 casey@domain.com 3 casey@domain.com 4 casey@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. > I just want 1 LeadID and 1 Email out of the 4 records. Which one LeadID? If you want the min, just do: SELECT Email MIN(LeadID) AS LeadID FROM Leads group by Email On Wed, Mar 17, 2010 at 11:25 AM, Casey Dougall < casey@uberwebsitesolutions.com> wrote: ----- Excess quoted text cut - see Original Post for more -----
|
July 31, 2010
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||