title: SQLAlchemy: FROM entry still present in correlated subquery
body: <p>I'm trying to build the following query (to be used as a subquery with a containing query that defines an alias named <code>tbl_outer</code>) with SQLAlchemy:</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT max(tbl.ts) AS max_1
  FROM tbl
  WHERE tbl.id = tbl_outer.id
  </code></pre>
  
  <p>As I read the documentation, the correct way to prevent <code>tbl_outer</code> references from being present in the FROM clause is <code>query = query.correlate(tbl_outer)</code>.
  However, instead, I'm getting this, as if <code>correlate()</code> had not been called at all:</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT max(tbl.ts) AS max_1
  FROM tbl, tbl AS tbl_outer
  WHERE tbl.id = tbl_outer.id
  </code></pre>
  
  <p>A minimal reproducer follows:</p>
  
  <pre class="lang-py prettyprint-override"><code>import sqlalchemy as sa
  import sqlalchemy.orm as sa_orm
  
  engine  = sa.create_engine('sqlite:///memory')
  meta    = sa.MetaData(bind=engine)
  table   = sa.Table('tbl', meta, sa.Column('id', sa.Integer), sa.Column('ts', sa.Integer))
  session = sa_orm.sessionmaker(bind=engine)()
  meta.create_all()
  
  tbl_outer = table.alias('tbl_outer')
  
  subquery = session.query(sa.func.max(table.columns.ts)).filter(table.columns.id == tbl_outer.columns.id)
  
  print "=== BEFORE CORRELATION:"
  print str(subquery)
  
  print "=== AFTER CORRELATION:"
  print str(subquery.correlate(tbl_outer))
  </code></pre>
  
  <hr>
  
  <p>As I read <A HREF="http://docs.sqlalchemy.org/en/rel_0_7/orm/query.html#sqlalchemy.orm.query.Query.correlate" rel="nofollow">the documentation for correlate()</A>, and <A HREF="http://stackoverflow.com/questions/13056049/how-to-specify-the-from-tables-in-sqlalchemy-subqueries">other answers describing its correct use here on StackOverflow</A>, I would expect this <code>correlate(tbl_outer)</code> call to remove <code>tbl AS tbl_outer</code> from the <code>FROM</code> clause of the generated SQL; however, it does not do so in practice.</p>
  
  <p>I've received the above results with SQLAlchemy 1.0.8. What am I missing?</p>