Bug #8761 Using LEFT JOIN creates a resultset with NULL values when there is no ID common
| Submitted: | 24 Feb 2005 0:25 | Modified: | 25 Feb 2005 19:50 |
|---|---|---|---|
| Reporter: | Disha | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server | Severity: | S3 (Non-critical) |
| Version: | 5.0.2 | OS: | Windows (Windows 2003) |
| Assigned to: | CPU Architecture: | Any |
[24 Feb 2005 0:25]
Disha
[24 Feb 2005 5:41]
MySQL Verification Team
Couldf you please send a test case with a dump of the tables and the query using the same tables names. Thanks.
[25 Feb 2005 19:50]
Trudy Pelzer
This is not a bug. First, tables asht1 and asht2 do not exist. But if one changes the query to: mysql> select t1.fname, t2.fname, t2.count from t1 LEFT JOIN t2 ON t1.fname=t2.fname; +-------+-------+-------+ | fname | fname | count | +-------+-------+-------+ | A1 | NULL | NULL | | M2 | NULL | NULL | | F3 | NULL | NULL | | C4 | NULL | NULL | | V5| NULL | NULL | +-------+-------+-------+ 5 rows in set (0.00 sec) One gets the correct result: every value of fname in table t1, with NULLs for the non-matching values in table t2. Adding the extra column makes it clear the result is correct, but even without the extra column, MySQL is returning the correct result.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.