OUTER portion of LEFT JOIN defunct?

OUTER portion of LEFT JOIN defunct?

am 17.08.2002 12:34:46 von Michael Widenius

Hi!

Sorry for the late responce but I have been on vacation and I am still
catching up with my emails..

Nic> While running MySQL 4.0.2-alpha under Win32, the OUTER portion of a LEFT
Nic> JOIN causes me trouble. If two columns of the same name, but from
Nic> different tables, are SELECTed, the left column appears as NULL when the
Nic> right column is NULL. Modifying the command to use RIGHT JOIN, the OUTER
Nic> portion of the results appear as expected.

Nic> Nic Ivy

Nic> # This command appears to give incorrect results.
Nic> # Shouldn't there be a row of ('1', NULL)?
Nic> SELECT left_table.id,right_table.id FROM left_table LEFT JOIN right_table
Nic> ON left_table.id=right_table.id

Sorry, but what do you mean with the above:

The result I get (with the upcomming 4.0.3-beta version) is:

+----+------+
| id | id |
+----+------+
| 1 | NULL |
| 2 | 2 |
| 3 | 3 |
+----+------+

Did you get the row with NULL or not ?

As Sinisa explained, the NULL row should be there as there is no
matching row in the right_table for id = 1

Regards,
Monty

--
For technical support contracts, goto https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Michael Widenius
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, CTO
/_/ /_/\_, /___/\___\_\___/ Helsinki, Finland
<___/ www.mysql.com


------------------------------------------------------------ ---------
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 bugs-thread12358@lists.mysql.com
To unsubscribe, e-mail