RE: anyone help with this query? Returning tooooo many results

2004-07-09 Thread Aaron Wolski
] > Subject: RE: anyone help with this query? Returning to many results > > > Aaron, > > That would be an INNER JOIN situation: > > SELECT a.ID, a.First, a.Last, a.Email > FROM producta_customers a > INNER JOIN productb_customers b >ON a.email=b.email &g

RE: anyone help with this query? Returning tooooo many results

2004-07-09 Thread SGreen
t; -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: July 9, 2004 12:17 PM > To: Aaron Wolski > Cc: [EMAIL PROTECTED] > Subject: Re: anyone help with this query? Returning to many results > > > You have written a cross-product j

RE: anyone help with this query? Returning tooooo many results

2004-07-09 Thread Aaron Wolski
> WHERE b.id is null > > This will give you all of the records in producta_customers that DO NOT > have a matching email address in the productb_customers table. > > Yours, > Shawn Green > Database Administrator > Unimin Corporation - Spruce Pine > > > >

Re: anyone help with this query? Returning tooooo many results

2004-07-09 Thread SGreen
Fax to: 07/09/

Re: anyone help with this query? Returning tooooo many results

2004-07-09 Thread Philippe Poelvoorde
From the documentation mysql> SELECT table1.* FROM table1 ->LEFT JOIN table2 ON table1.id=table2.id ->WHERE table2.id IS NULL; will normally give you the right answer. and you should get : 2026 x 240 - 486,057 = 183 results Aaron Wolski wrote: Hi all, Having a problem with

Re: anyone help with this query? Returning tooooo many results

2004-07-09 Thread Alec . Cawley
"Aaron Wolski" <[EMAIL PROTECTED]> wrote on 09/07/2004 16:33:27: > Hi all, > > Having a problem with a query that's returning 486,057 results when it > most definitely should NOT be doing that. > > I have two tables: > > 1 for a list of customers that purchase product A, another for customers >

RE: anyone help with this query? Returning tooooo many results

2004-07-09 Thread Victor Pendleton
It sounds like a cartesian join. Have you run an explain plan on this query? What are you joining the two tables on? -Original Message- From: Aaron Wolski To: [EMAIL PROTECTED] Sent: 7/9/04 10:33 AM Subject: anyone help with this query? Returning to many results Hi all, Having a

Re: anyone help with this query? Returning tooooo many results

2004-07-09 Thread Martijn Tonies
Hi Aaron, > Having a problem with a query that's returning 486,057 results when it > most definitely should NOT be doing that. > > I have two tables: > > 1 for a list of customers that purchase product A, another for customers > who purchased product B. > > Columns are: > > Id > First > Last > Ema

anyone help with this query? Returning tooooo many results

2004-07-09 Thread Aaron Wolski
Hi all, Having a problem with a query that's returning 486,057 results when it most definitely should NOT be doing that. I have two tables: 1 for a list of customers that purchase product A, another for customers who purchased product B. Columns are: Id First Last Email I am trying to compare