House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

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

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Hi,
Casey Dougall
03/17/10 02:11 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Casey Dougall
03/17/2010 02:11 PM

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.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
John M Bliss
03/17/2010 02:36 PM

> 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 -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

July 31, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
         1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31