• Well that subquery for temp table 2 is using a left join not an inner join to temp table 1.

    Also, caps lock cruise control for cool.