[snip]
This happens because a 'normal' join is like a multiplicative product
between all the rows matched in all the tables:
result_rows = a_rows * b_rows * c_rows * d_rows
so if any of the factors are zero, the result is zero.
Your WHERE clause will cut down on the number of rows you get back, and you
expect that the optimizer will prevent this obscene number of rows from ever
really being generated, but this is how it logically works.

If you want different behavior, you can use a LEFT JOIN, which effectively
rounds all the factors up to one by adding a row to each table with all NULL
fields.
[/snip]

Thanks Rob....I should've stayed in bed this morning! Some days I feel like
such a Homer Simpson, "d'oh!"! I completely forgot blanked on doing a LOJ.
OTOH this is just proof of why developers should not work in a vacuum as we
all suffer from brain paralysis from time-to-time.

Have a great weekend!

Jay
mysql, sql, query

"It's hip to snip!"






---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to