I would have assumed that was what you wanted - i.e. "Are you the Mr Smith that owns Freddy the frog?". You would need to return one record per pet, with owners appearing as many times as they had pets. Otherwise, why link to the pet table at all here?
However, once you cut down on the fields you actually want to see, if you then have multiple retrievals that are exactly the same, you can use "distinct" to eliminate the duplicates. Obviously, if you're only looking for the Mr Smith's that have dogs, you can use a where test on the pet table to select by pet type. PS, it's not really the third table that's doing this. If you simply keyed the pet table with the owner's full name, you'd still get the same thing, because multiple pet records would have the same owner. Do you have a problem with broken homes - i.e. the same pet has two owners? That'd really get the hair pulling going. :-) Dave S ----- Original Message ----- From: "Dian D. Chapman" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Wednesday, April 13, 2005 11:44 AM Subject: RE: [ASP] 3rd table query, getting double returns? > > Further to the item below...I just messed with the query in the ASA query > editor and realized I'm getting TWO client lists, due to the fact that each > (of this sample data) happens to have two pets. So it is pulling two client > names due to the fact that there are two patient matches in that 3rd > matching table. > > So it's saying...here's one match, here's another, due to the two clientIDs > in the OWNER table...one for the owner's dog, one for the owner's cat. > > ARRGGHHH! Why the hell do devs use this third table!<grrrrr> > > TIA for any help! > > Dian ~ --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [email protected] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/active-server-pages/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
