SQLite Forum

joining tables on multiple conditions; how to do it when second table lacks some rows?
Login
If I understand your problem correctly, using a:

LEFT OUTER JOIN

is what you need to do. It returns all the rows from the left-hand table, with matching data from the right-hand table if there is any, and NULL if there is not.