I am trying to join a group by subquery with another table but am running in to issues since the subquery contains aliases which are only valid within the subquery. The issu