title: SQLAlchemy Subquery List Object has no Attribute
body: <p>Hello? I am trying to write a query (which has 2 subqueries) in SQLAlchemy but I am getting an error AttributeError: 'list' object has no attribute 'l_date'</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import sqlalchemy as db
  from sqlalchemy import func
  from sqlalchemy import desc
  from sqlalchemy.orm import sessionmaker
  from sqlalchemy import or_
  from sqlalchemy import and_
  from sqlalchemy.sql.expression import  alias
  
  try:
  
      engine = db.create_engine('postgresql://user:pass@localhost:5432/db_name')
      connection = engine.connect()
  
  except:
      print('Error establishing DB connection')
  
  # Import metadata
  metadata = db.MetaData()
  
  # create a configured "Session" class
  Session = sessionmaker(bind=engine)
  
  # create a Session
  session = Session()
  
  # Import articles, authors and log tables
  log = db.Table('log', metadata, autoload=True, autoload_with=engine)
  
  
  def days_with_request_errors():
      query1 = db.select([func.DATE(log.columns.time).label('l_date'), func.count(log.columns.status).label('s_count')]) \
          .where(or_(log.columns.status.like('%5%'), log.columns.status.like('%4%'))) \
          .group_by(func.DATE(log.columns.time))
  
      ResultProxy = connection.execute(query1)
      q1 = ResultProxy.fetchall()
  
      query2 = db.select([func.DATE(log.columns.time).label('l_date'),
                            func.count(log.columns.status).label('s_count')]) \
          .group_by(func.DATE(log.columns.time))
  
      ResultProxy = connection.execute(query2)
      q2 = ResultProxy.fetchall()
  
      main_query = db.select([q1.l_date, (q1.s_count * 100) / q2.s_count]) \
          .where(q1.l_date == q2.l_date) \
          .where(and_((q1.c.s_count * 100) / q2.c.s_count) &gt; 1)
  
      ResultProxy = connection.execute(main_query)
      return ResultProxy.fetchall()
  </code></pre>
  
  <p>Here is the raw SQL query which I am transfering to SQLAlchemy. (The raw query is working fine):</p>
  
  <pre><code>SELECT q1.date, ((q1.count * 100) / q2.count) as percentage
    FROM (SELECT date(time) as date, COUNT(status) as count
          FROM log
          WHERE status LIKE '%4%' or status LIKE '%5%'
          GROUP BY date(time)) as q1,
         (SELECT date(time) as date, COUNT(status) as count
          FROM log
          GROUP BY date(time)) as q2
    WHERE q1.date = q2.date and ((q1.count * 100) / q2.count) &gt; 1
  </code></pre>
  
  <p>Any help will be greatly appreciated.</p>