List:General Discussion« Previous MessageNext Message »
From:Paul Lawton Date:April 15 1999 9:36am
Subject:Wading straight in...
View as plain text  
Hi there, My name's Paul, I've just joined the list and I'm gonna be rude and
jump straight in with a question!

I'm trying to extract the distinct emails from a table with about 30 fields in
it. The following:
select distinct(email) from table;

is fine. But when I want the associated fields as well e.g. id,name etc
select distinct(email),id,name from table;

I get too many records as it seems to be doing a distinct on the id as well.

I have solved the problem using 2 nested statements in PHP but I was wondering
if there
was a more elegant way of doing it in one select statement.


Paul Lawton     Raver / Software Engineer     Modem Media . Poppe Tyson
Tel: 44 171 878 5723                          [ http://sscape.bog.net ]
ICQ: 10999748                                    [ http://www.ush.net ]
       .oO[ I'll never grow old because of my personality! ]Oo.

Thread
Wading straight in...Paul Lawton15 Apr
  • Re: Wading straight in...kalle volkov15 Apr
    • RE: (Wading straight in...) (Query Help)Jay Miller15 Apr