title: Using alias() for 'select as' in SQLAlchemy
body: <p>Let's say I have a table 'shares' with the following columns:</p>
  <pre><code>company    price    quantity
  Microsoft  100      10
  Google     99       5
  Google     99       20
  Google     101      15
  </code></pre>
  <p>I'd like to run the equivalent of a SQL statement like this:</p>
  <pre class="lang-sql prettyprint-override"><code>select price, 
         sum(quantity) as num 
  from shares 
  where company='Google' 
  group by price;
  </code></pre>
  <p>The closest I've come is:</p>
  <pre class="lang-py prettyprint-override"><code>result = (dbsession.query(Shares.price, func.sum(Shares.quantity))
           .filter(Shares.company == 'Google')
           .group_by(Shares.price)
           .all())
  </code></pre>
  <p>I'm having trouble with setting up the 'sum(quantity) as num' in sqlalchemy. It appears I need to use alias() but I can't figure out how by looking at the documentation.</p>