Please, could you remove the inner query and use a join between the two tables?