Jeff
Why are you doing a LEFT JOIN instead of a INNER JOIN
right now you are getting all rows from first table regardless of match
condition so all of the rows for
a.ProductID FROM ImportLiebermansStep3Add
are being returned
try the inner join instead
Martin
----- Original Message -----
From: "Jeff Gannaway" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 10, 2004 5:18 PM
Subject: Need help with my LEFT JOIN query...


> I'm trying to SELECT a field (ProductID) from 'Table a' WHERE two
> corresponding fields are equal (a.PUBLISHER = b.Vendor AND a.NUMBER =
b.VIN)
>
>
> Table 'a' (approximately 100,000 records):
> +================================+
> | ImportLiebermansStep3Add       |
> +================================+
> | ProductID | PUBLISHER | NUMBER |
> +-----------+-----------+--------+
> | ACC_4076  | ACC       | 4076   |
> | BCD_300   | BCD       | 300    |
> | DEC_R50   | DEC       | R50    |
> | WIN_220   | WIN       | 220    |
> +-----------+-----------+--------+
>
> Table 'b' (approximately 20,000 records):
> +================================+
> | ProductsOLD                    |
> +================================+
> | ProductID | Vendor    | VIN    |
> +-----------+-----------+--------+
> |           | ACC       | 4076   |
> |           | BCD       | 9999   |
> |           | DEC       | R50    |
> +-----------+-----------+--------+
>
>
> Here's my Query....
>
> SELECT a.ProductID FROM ImportLiebermansStep3Add a
> LEFT JOIN ProductsOLD b ON a.PUBLISHER=b.Vendor AND a.NUMBER=b.VIN
> WHERE b.ProductID IS NULL;
>
> But this query runs, and runs, and runs, and runs, and runs without ever
> giving results.
>
> What am I missing???
>
> Thanks!
> -Jeff Gannaway
> _______________________________________________
>
> http://RadioU.com
> This Is Where Music Is Going - Listen Online!
> _______________________________________________
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
>
>

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to