-1

This is a pretty straightforward LEFT OUTER JOIN, but I get zero returned rows:

SELECT All_varieties.*,variety_join.*
FROM All_varieties LEFT JOIN 
     variety_join 
     ON All_varieties.varietyID = variety_join.varietyID
WHERE (variety_join.sourceID = Null);

However, I am using a query 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;

Is the problem maybe with the query All_varieties?

TABLES: enter image description here

Elizabeth
  • 61
  • 1
  • 10
  • 3
    Does this answer your question? [SQL is null and = null](https://stackoverflow.com/questions/9581745/sql-is-null-and-null) – Erik A Nov 15 '19 at 10:28
  • This is not clear. Which query is the one you have a problem with & what is the problem? What does "However, I am using a query All_varieties" mean? PS When this is clear it is going to be a faq. Before considering posting please always google your error message or many clear, concise & precise phrasings of your question/problem/goal, with & without your particular strings/names & site:stackoverflow.com & tags, & read many answers. If you post a question, use one phrasing as title. See [ask] & the voting arrow mouseover texts. – philipxy Nov 15 '19 at 10:45
  • Please in code questions give a [mre]--cut & paste & runnable code; example input (as initialization code) with desired & actual output (including verbatim error messages); tags & versions; clear specification & explanation. For errors that includes the least code you can give that is code that you show is OK extended by code that you show is not OK. (Debugging fundamental.) For SQL that includes DBMS/product & DDL, which includes constraints & indexes & tabular initialization. – philipxy Nov 15 '19 at 10:47
  • @ErikA Yes, basically. Thanks – Elizabeth Nov 15 '19 at 11:39
  • @philipxy I don't really follow all of that - the question was answered. I think I made the problem fairly clear - "...but I get zero returned rows." And I showed a picture of my tables - you did see this is in MSAccess right? It's a very quick, small database. – Elizabeth Nov 15 '19 at 11:41

1 Answers1

2

It should be variety_join.sourceID is null instead of 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
Fahmi
  • 37,315
  • 5
  • 22
  • 31