This could use some more documentation. Like explaining why you need to use a subquery, what the subquery does, etc..