title: Returning distinct rows in SQLAlchemy with SQLite
body: <p>SQLAlchemy's <a href="http://docs.sqlalchemy.org/en/rel_0_8/orm/query.html#sqlalchemy.orm.query.Query.distinct">Query.distinct</a> method is behaving inconsistently:</p>
  
  <pre><code>&gt;&gt;&gt; [tag.name for tag in session.query(Tag).all()]
  [u'Male', u'Male', u'Ninja', u'Pirate']
  &gt;&gt;&gt; session.query(Tag).distinct(Tag.name).count()
  4
  &gt;&gt;&gt; session.query(Tag.name).distinct().count()
  3
  </code></pre>
  
  <p>So the second form gives the correct result but the first form does not.  This appears to happen with SQLite but NOT with Postgres.  I have a function which is passed a query object to have a <code>distinct</code> clause applied to it, so it would be highly difficult to rewrite everything top use the second approach above.  Is there something obvious that I'm missing?</p>