Join on a named subquery