• Just quickly off the top of my head, and without looking in detail at the query, have you looked at left and right joins instead of the inner join?

    Give me everything from table 1 regardless of its existence in table 2 and then give me details, where they exist, from table 2? This would be a left outer join.