title: JOIN same table twice with aliases on SQLAlchemy
body: <p>I am trying to port the following query to SQLAlchemy:</p>
  
  <pre><code>SELECT u.username, GROUP_CONCAT(DISTINCT userS.name)
  FROM Skills AS filterS 
  INNER JOIN UserSkills AS ufs ON filterS.id = ufs.skill_id
  INNER JOIN Users AS u ON ufs.user_id = u.id
  INNER JOIN UserSkills AS us ON u.id = us.user_id
  INNER JOIN Skills AS userS ON us.skill_id = userS.id
  WHERE filterS.name IN ('C#', 'SQL')
  GROUP BY u.id;
  </code></pre>
  
  <p>I don't understand how to achieve AS statement in SQLAlchemy. Here is what I currently have:</p>
  
  <pre><code># User class has attribute skills, that points to class UserSkill
  # UserSkill class has attribute skill, that points to class Skill
  db.session.query(User.id, User.username, func.group_concat(Skill.name).label('skills')).\
     join(User.skills).\
     join(UserSkill.skill).filter(Skill.id.in_(skillIds)).\
     order_by(desc(func.count(Skill.id))).\
     group_by(User.id).all()
  </code></pre>
  
  <p>Please help.</p>