]
> 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
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
> 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
>
>
>
>
Fax to:
07/09/
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
"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
>
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
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
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