Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> SQL - using 'distinct'
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
![]() |
![]() |