Running mySQL Community Server 5.5.13
Using the following query:
select t1.f1, t2.f1, t2.f2
from t1 left join t2 on (t1.f3 = t2.f3)
If the left join finds no matches in table t2, rather than putting nulls in the values for t2.f1, t2.f2, it is actually putting the column names there.
Any suggestions why this migh开发者_如何学编程t be happening?
Try this:
SELECT `t1`.`f1`, `t2`.`f1`, `t2`.`f2`
FROM `t1`
LEFT JOIN `t2` ON `t1`.`f3` = `t2`.`f3`;
精彩评论