Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help with DISTINCT
amerar_at_iwc.net wrote:
> On Mar 6, 1:04 pm, DA Morgan <damor..._at_psoug.org> wrote: >> ame..._at_iwc.net wrote:
>> My first thought is SELECT DISTINCT but it would seem from what little >> you have provided that each person can have one, and only one, email >> address so please define DISTINCT as you are using it. >> -- >> Daniel A. Morgan >> University of Washington >> damor..._at_x.washington.edu >> (replace x with u to respond) >> Puget Sound Oracle Users Groupwww.psoug.org- Hide quoted text - >> >> - Show quoted text - > > > Well, DISTINCT in the moddile of this query will not work. I am > looking to get one and only one of each email address, regardless of > the other values in the other columns......
Then redesign your application. That is not what it was built to do.
What you are indicating with your response is that a single customer_id with a single customer_vistor_id can point to multiple customers in your customer_visitor table. You will be fighting this nonsense for the rest of the application's life.
The only alternative is to use MAX or MIN to grab one, and only one, email address but that a poor substitute for a good design.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Tue Mar 06 2007 - 16:06:04 CST