Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> SQL - using 'distinct'

SQL - using 'distinct'

From: Russell Fray <russ_at_u-net.net>
Date: Wed, 02 Sep 1998 21:00:04 GMT
Message-ID: <35edb134.31040591@news.u-net.com>

I have a table named 'customer'.

I want to produce a mailing list from this table, and weed out duplicates. I was trying to use :

select distinct name, address, customer_id from customer;

In theory this should work, but many people have more than one customer_id (as they have more than one account). I want to distinct on everything APART from customer_id, so if addressing information is duplication only one instance is listed.

The above example of course doesn't weed out the duplicates because although name & address are the same, the customer_id is different in each instance.

I'm stuck here - any suggestions?

Please cc replies to russ_at_u-net.net

Regards,
Russell. Received on Wed Sep 02 1998 - 16:00:04 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US