这是一个非常简单的LEFT OUTER JOIN
,但返回的行为零:
SELECT All_varieties.*,variety_join.*
FROM All_varieties LEFT JOIN
variety_join
ON All_varieties.varietyID = variety_join.varietyID
WHERE (variety_join.sourceID = Null);
但是,我正在使用查询 All_varieties
SELECT plant.plantName, plant.plantGenus, plant.plantSpecies, variety.varietyLatin, variety.varietyEnglish, variety.varietyID
FROM plant LEFT JOIN
variety
ON plant.plantID = variety.plantID;
查询 All_varieties 可能是问题所在吗?
答案 0 :(得分:2)
应为variety_join.sourceID is null
而不是variety_join.sourceID = Null
SELECT All_varieties.*,variety_join.*
FROM All_varieties LEFT JOIN
variety_join
ON All_varieties.varietyID = variety_join.varietyID
WHERE variety_join.sourceID is Null